DevOps Tools Engineer (LPIC-OT 701) — Question 46

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

Answer options

Correct answer: B

Explanation

The correct answer, B, is true because the --mode global setting specifies that the service will run one instance on each node in the Swarm. Option A is incorrect as the service runs multiple instances, one per node. Option C is also wrong because it does not run on a single node by default but rather on all nodes. Option D is misleading since it doesn't just run on nodes providing the network but on all nodes regardless of network. Option E is incorrect as global mode doesn't depend on network type compatibility.