0
0
Dockerdevops~10 mins

Overlay networks in Swarm in Docker - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to create an overlay network named 'mynetwork' in Docker Swarm.

Docker
docker network create -d [1] mynetwork
Drag options to blanks, or click blank then click option'
Abridge
Boverlay
Chost
Dmacvlan
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bridge' driver which only works on a single host.
Using 'host' which shares the host network stack.
Using 'macvlan' which is for direct host network access.
2fill in blank
medium

Complete the command to attach a service named 'web' to the overlay network 'mynetwork'.

Docker
docker service create --name web --network [1] nginx
Drag options to blanks, or click blank then click option'
Ahost
Bbridge
Cdefault
Dmynetwork
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bridge' which is not the overlay network.
Using 'host' which bypasses Docker networking.
Using 'default' which may not exist or be overlay.
3fill in blank
hard

Fix the error in the command to inspect the overlay network named 'mynetwork'.

Docker
docker network [1] mynetwork
Drag options to blanks, or click blank then click option'
Ainspect
Bcreate
Crm
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'list' which shows all networks but not details.
Using 'create' which tries to make a new network.
Using 'rm' which deletes the network.
4fill in blank
hard

Fill both blanks to create an overlay network with encryption enabled and attach it to a service named 'db'.

Docker
docker network create -d [1] --opt encrypted=[2] secure_net && docker service create --name db --network secure_net postgres
Drag options to blanks, or click blank then click option'
Aoverlay
Btrue
Cfalse
Dbridge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bridge' driver which does not support encryption in Swarm.
Setting encrypted option to 'false' which disables encryption.
5fill in blank
hard

Fill all three blanks to create a service named 'app' attached to two overlay networks 'frontend' and 'backend'.

Docker
docker network create -d [1] frontend && docker network create -d [2] backend && docker service create --name app --network [3] nginx
Drag options to blanks, or click blank then click option'
Aoverlay
Bbridge
Cfrontend
Dbackend
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bridge' driver which is not for Swarm overlay networks.
Confusing network names in the service command.