docker的默认ip是172.17.0.1,当其网段与局域网段冲突时就需要手动更改.方法如下:

     输入以下命令:

systemctl stop docker
sudo vim /etc/docker/daemon.json

    在daemon.json中输入:       

{
"registry-mirrors": ["https://00s5k4m1.mirror.aliyuncs.com"],"bip": "192.168.12.1/16"
}

     保存后运行:

systemctl start docker

    这时再用ifconfig发现docker ip已修改为192.168.12.1/16.

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐