问题描述
我在尝试在多主机网络中创建一个容器,但在创建时收到此错误:守护进程:网络myapp未找到
这里 myapp
是我创建的覆盖网络的名称。我使用的命令是:
sudo docker运行--rm -it --name = test_cont --net = myapp ubuntu bash
Docker网络的范围是不同的访问。您的 myapp
网络是范围为群集的覆盖网络。
这意味着您只能在群集级别 - 码头服务创建 - 网络myapp
可以正常工作,因为服务也在群集级别。
您可以在群集上启动 docker run
的容器,但它只会在运行命令的节点上本地运行,因此无法看到群组网络。 p>
I am trying to create a container in a multihost network but while creating I am getting this error:
Error response from daemon: network myapp not found
Here myapp
is the name of overlay network which i have created. The command I am using is:
sudo docker run --rm -it --name=test_cont --net=myapp ubuntu bash
Docker networks are scoped for different access. Your myapp
network is an overlay network scoped to the swarm.
That means you can only use it at swarm level - docker service create --network myapp
will work fine, because services are at swarm level too.
You can start a container with docker run
on a swarm, but it will only run locally on the node where you run the command on, so it can't see swarm networks.
这篇关于来自守护进程的响应错误:未找到网络myapp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!