当前位置:   article > 正文

docker修改服务器ip地址,如何修改docker的ip地址

docker两种方式 改vmip

d23a062196c2a10e582bc30d21766ed1.png

如何修改docker的ip地址?

一、查看Docker IProot@master:/# ifconfig docker0docker0: flags=4099 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 IProot@master:/# ifconfig docker0docker0: flags=4099 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

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号