如何修改docker的ip地址
时间:2020-06-08 17:03
如何修改docker的ip地址?
一、查看Docker IP
root@master:/# ifconfig docker0docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 172.17.10.1 netmask 255.255.0.0 broadcast 172.17.255.255 ether 02:42:4e:31:70:a8 txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
二、修改IP地址 [切勿与宿主机同网段]
vi /etc/docker/daemon.json
增加以下内容()
{ "registry-mirrors": [ "https://docs.docker.com" ], "bip": "172.17.10.1/16"}
三、重启Docker服务
service docker restart
四、查看修改后的Docker IP
root@master:/# ifconfig docker0docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 172.17.11.1 netmask 255.255.0.0 broadcast 172.17.255.255 ether 02:42:4e:31:70:a8 txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
相关推荐:docker教程
以上就是如何修改docker的ip地址的详细内容,更多请关注gxlcms其它相关文章!