Home >Operation and Maintenance >Docker >How to modify docker's ip address

How to modify docker's ip address

WJ
WJOriginal
2020-06-08 17:03:187584browse

How to modify docker's ip address

How to modify docker’s ip address?

1. Check the 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

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=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

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn