Docker修改IP地址方法

一、查看Docker IP

root@master:/# ifconfig docker0
docker0: 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 docker0
docker0: 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

(转发请注明出处:http://www.cnblogs.com/zhangyongli2011/ 如发现有错,请留言,谢谢)

posted @ 2020-05-28 16:38  非法小恋  阅读(12306)  评论(0编辑  收藏  举报