gpt4 book ai didi

docker - 如何防止在覆盖模式下绑定(bind)到 docker0 网桥

转载 作者:行者123 更新时间:2023-12-02 19:11:35 25 4
gpt4 key购买 nike

我正在尝试将 docker 与 weave 一起使用,并且我想保持容器中的接口(interface)清洁。那就是:我希望唯一的附加接口(interface)是编织和本地主机。目前 docker 也绑定(bind)了它的网桥。

是否可以仅附加到 Docker 中的覆盖网络?

$ docker run -ti --net none busybox ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0


eth1      Link encap:Ethernet  HWaddr 02:42:AC:12:00:02
inet addr:172.18.0.2 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:acff:fe12:2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:90 (90.0 B) TX bytes:270 (270.0 B)

ethwe0 Link encap:Ethernet HWaddr 52:E6:28:21:75:9A
inet addr:10.0.0.2 Bcast:0.0.0.0 Mask:255.255.255.0
inet6 addr: fe80::50e6:28ff:fe21:759a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1410 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:508 (508.0 B) TX bytes:258 (258.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

最佳答案

需要使用 -internal 创建网络标志,见:

https://github.com/docker/docker/issues/18854

关于docker - 如何防止在覆盖模式下绑定(bind)到 docker0 网桥,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35857159/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com