本文介绍了docker network create命令-swarm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面是用于为群集集群创建 overlay
网络驱动程序的命令,而不是使用 bridge
网络驱动程序
Below is the command used to create overlay
network driver for swarm cluster instead of using bridge
network driver
$ docker network create -d overlay xyz
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
9c431bc9fec7 bridge bridge local
88a4c6a29fa4 docker_gwbridge bridge local
10a4bc649237 host host local
o79qllmq86xw ingress overlay swarm
417aca5efd6b none null local
nsteeoxfu9b1 xyz overlay swarm
$
$ docker service create --name service_name --network xyz -p 80:80 --repicas 12 <image>
使用选项-network xyz
?这是网络名称空间驱动程序吗?
What exactly is the purpose of service command using option --network xyz
? is this the network namespace driver?
推荐答案
docker服务create --network
被描述为网络附件
(请参阅 docker service create --help
),它是将服务附加到现有的 docker
网络
,如。您可以将服务附加到多个 docker
网络
。
docker service create --network
is described as Network attachments
(ref. docker service create --help
), it is to attach a service to an existing docker
network
as documented here. You can attach a service to multiple docker
networks
.
这篇关于docker network create命令-swarm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!