1. 打开 cat /etc/docker/daemon.json 添加 "bip":"192.168.0.1/16", 配置如下
{
"bip":"192.168.0.1/16",
"data-root": "/data/bkce/public/paas_agent/docker",
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "500m",
"max-file":"5"
},
"storage-driver": "overlay2",
"storage-opts": [
"overlay2.override_kernel_check=true"
]
}
2.systemctl daemon-reload && systemctl restart docker
3.查看效果
docker inspect 容器ID 或者 docker exec 容器ID ifconfig
标签:容器,网段,自定义,0.1,ip,docker,opts From: https://www.cnblogs.com/zbhlinux/p/16818470.html