docker compose 设置 ip地址
程序员文章站
2022-05-15 13:09:06
...
docker compose 设置 ip地址
*********************
相关操作
docker-compose.yml
version: "3.8"
services:
redis:
image: redis
container_name: redis
networks:
fixed:
ipv4_address: "172.20.0.8"
networks:
fixed:
ipam:
driver: default
config:
- subnet: "172.20.0.0/24"
创建启动容器:docker-compose up -d
查看 ip地址
ip地址设置为 172.20.0.8