如何修改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位址的詳細內容。更多資訊請關注PHP中文網其他相關文章!