指定ip到docker容器失败

igetnqfo  于 2021-06-09  发布在  Redis
关注(0)|答案(0)|浏览(300)

我有两台装有ubuntu16.0.4的机器(a,b)。安装了docker(版本18.03.0-ce)和weave(版本2.3.0)。当我尝试用指定的ip启动redis docker容器时:

docker run --name redis-master --net weave --ip 192.168.30.11 -d redis:5.0.8 redis-server --appendonly yes

它在机器a上正常工作,而在机器b上失败,错误消息:

docker: Error response from daemon: Invalid address 192.168.30.11: It does not belong to any of this network's subnets.

在机器a上,docker网络列表:

NETWORK ID          NAME                DRIVER              SCOPE
f5365db452bd        bridge              bridge              local
cda951aee0a8        docker_gwbridge     bridge              local
38511d6122df        host                host                local
6e64da3a25e2        none                null                local
8d74a493f63e        weave               weavemesh           local

在机器b上,docker网络列表:

NETWORK ID          NAME                DRIVER              SCOPE
d528e620daef        bridge              bridge              local
c4fffd9aa891        host                host                local
02731d6f3d25        none                null                local
ef57e48e09ec        weave               weavemesh           local

让我困惑的是,在机器a上,在运行“docker run--net weave--ipx”之后会出现网络“docker\u gwbridge”,但在机器b上,没有网络“docker\u gwbridge”。
谁能帮帮我,“ Docker 桥”是从哪里来的?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题