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

How to modify docker's ip address

WJ
Release: 2020-06-08 17:03:18
Original
7590 people have browsed it

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
Copy after login

2. Modify the IP address [Do not be on the same network segment as the host ]

vi /etc/docker/daemon.json
Copy after login

Add the following content ()

{ "registry-mirrors": [ "https://docs.docker.com"
  ], "bip": "172.17.10.1/16"}
Copy after login

3. Restart the Docker service

service docker restart
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template