701-100 Exam QuestionsBrowse all questions from this exam

701-100 Exam - Question 20


What statement is true regarding the Swarm service created by the following command? docker service create --name myweb --network webnet --mode global nginx

Show Answer
Correct Answer: B

The correct answer is that the service runs exactly once on each node in a Swarm. The command uses the --mode global flag, which specifies that the service should run one instance on every node in the swarm. This ensures that the service will be present on each node rather than being replicated to an arbitrary number of instances or running only on nodes that provide a specific network.

Discussion

5 comments
Sign in to comment
hmagrounOption: B
Mar 25, 2020

it's "B" "Set service mode (--mode) The service mode determines whether this is a replicated service or a global service. A replicated service runs as many tasks as specified, while a global service runs on each active node in the swarm." see: https://docs.docker.com/engine/reference/commandline/service_create/#set-service-mode---mode

[Removed]Option: B
Mar 1, 2022

It’s B https://docs.docker.com/engine/swarm/services/#replicated-or-global-services

pavkataOption: B
Jun 13, 2020

while a global service runs on each active node in the swarm. https://docs.docker.com/engine/reference/commandline/service_create/

Blob21Option: B
Jun 23, 2021

https://docs.docker.com/engine/swarm/how-swarm-mode-works/services/ its B

PeixinhoOption: D
Apr 25, 2023

The correct answer is D. The command docker service create --name myweb --network webnet --mode global nginx creates a Swarm service named "myweb" using the "nginx" image. The --network webnet option specifies that the service should be connected to the "webnet" overlay network. The --mode global option specifies that the service should run one replica per node, on all nodes which provide the "webnet" network. Therefore, the service runs on all nodes which provide the network "webnet". Option B is incorrect because the --mode global option ensures that the service runs once on each node that provides the specified network.