一开始是以 host 创建的容器,后来想切换成 bridge
命令:
docker network connect bridge ubuntu20
docker container start ubuntu
报错:
Error response from daemon: failed to add interface veth4569079 to sandbox: error setting interface "veth4569079" IP to 172.17.0.3/16: cannot program address 172.17.0.3/16 in sandbox interface because it conflicts with existing route {Ifindex: 16 Dst: 172.17.0.0/16 Src: 172.17.0.1 Gw: <nil> Flags: [] Table: 254} Error: failed to start containers: ubuntu20
但是换回 host 之后又能正常启动
用--network bridge
新创建的容器,inspect 查看配置由网关,而 host->bridge 的容器却没看到有网关的信息
1
Nnq 2022-04-30 00:02:10 +08:00
不是写了🈶️冲突么
|
2
julyclyde 2022-05-05 13:50:23 +08:00
bridge 的话你需要换一个 IP 地址了,和主网卡同网段的“隔壁”的 IP 地址
|