- docker network作成
作成
docker network create \
--subnet 172.100.0.0/24 \
intra
- docker コマンドの場合
run.sh
docker run -it --rm \
--net intra\
--ip 172.100.0.254 \
busybox
- docker-compose.yml
docker-compose.yml
version: "3"
services:
app:
restart: always
image: gogs/gogs
container_name: "gogs"
ports:
- "3000"
- "22"
volumes:
- ./data:/data
networks:
intra:
ipv4_address: 172.100.0.253
networks:
intra:
external: true