Bird
0
0

You created an overlay network with:

medium📝 Troubleshoot Q14 of 15
Docker - Swarm
You created an overlay network with:
docker network create -d overlay mynet

But when you try to connect a standalone container using docker run --net mynet, it fails. What is the likely cause?
AThe overlay network was not created with the --attachable flag
BThe container image is incompatible with overlay networks
CDocker Swarm mode is not initialized
DThe container must be part of a service to use overlay networks
Step-by-Step Solution
Solution:
  1. Step 1: Identify overlay network usage for standalone containers

    Standalone containers can only connect to overlay networks if the network was created with --attachable.
  2. Step 2: Evaluate other options

    The container image is incompatible with overlay networks is incorrect; container images do not affect network connection. Docker Swarm mode is not initialized is unrelated if network was created. The container must be part of a service to use overlay networks is false because attachable networks allow standalone containers.
  3. Final Answer:

    The overlay network was not created with the --attachable flag -> Option A
  4. Quick Check:

    Standalone container needs --attachable network [OK]
Quick Trick: Add --attachable to overlay network for standalone containers [OK]
Common Mistakes:
  • Ignoring the need for --attachable flag
  • Blaming container image compatibility
  • Assuming all overlay networks allow standalone containers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes