[英]Docker - how to avoid bridge ip?
Docker正在br-80db19b2a6a0接口上采用IP 172.19.0.1。 我想避免使用此ip,因為它映射到我們的郵件服務器。
這些是接口(Linux機器):
br-096c79c68bb1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:94ff:feb0:6dc9 prefixlen 64 scopeid 0x20<link>
ether 02:42:94:b0:6d:c9 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 106 bytes 14176 (14.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br-80db19b2a6a0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.19.0.1 netmask 255.255.0.0 broadcast 172.19.255.255
inet6 fe80::42:f3ff:fe4e:f91 prefixlen 64 scopeid 0x20<link>
ether 02:42:f3:4e:0f:91 txqueuelen 0 (Ethernet)
RX packets 466 bytes 18568 (18.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 515 bytes 40663 (40.6 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255
ether 02:42:dc:23:25:46 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
enp0s31f6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.18.17.167 netmask 255.255.255.0 broadcast 172.18.17.255
inet6 fe80::f68e:38ff:fefe:6cfd prefixlen 64 scopeid 0x20<link>
ether f4:8e:38:fe:6c:fd txqueuelen 1000 (Ethernet)
RX packets 1436 bytes 1254171 (1.2 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 818 bytes 125043 (125.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xee080000-ee0a0000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Loopback Local)
RX packets 3553 bytes 365530 (365.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3553 bytes 365530 (365.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
我該怎么做?
“使用--network標志啟動容器時,可以使用--ip或--ip6標志指定分配給該網絡上的容器的IP地址。”
在這里看看: https : //docs.docker.com/config/containers/container-networking/#dns-services
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.