Home>Article>Operation and Maintenance> How to modify docker’s ip address
How to modify docker’s ip address?
1. Check the Docker IP
root@master:/# ifconfig docker0docker0: flags=4099mtu 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
2. Modify the IP address [Do not be on the same network segment as the host ]
vi /etc/docker/daemon.json
Add the following content ()
{ "registry-mirrors": [ "https://docs.docker.com" ], "bip": "172.17.10.1/16"}
3. Restart the Docker service
service docker restart
4. View the modified Docker IP
root@master:/# ifconfig docker0docker0: flags=4099mtu 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
Related recommendations:docker tutorial
The above is the detailed content of How to modify docker’s ip address. For more information, please follow other related articles on the PHP Chinese website!