0
0
Dockerdevops~10 mins

Why container networking matters in Docker - Test Your Understanding

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

Complete the code to list all Docker networks on your system.

Docker
docker network [1]
Drag options to blanks, or click blank then click option'
Arm
Bcreate
Cstart
Dls
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' instead of 'ls' will try to make a new network, not list existing ones.
2fill in blank
medium

Complete the command to connect a running container named 'webapp' to a network called 'frontend'.

Docker
docker network connect [1] webapp
Drag options to blanks, or click blank then click option'
Abridge
Bfrontend
Cdefault
Dbackend
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bridge' connects to the default network, not the intended 'frontend' network.
3fill in blank
hard

Fix the error in the command to create a new Docker network named 'mynetwork' with the bridge driver.

Docker
docker network create --driver [1] mynetwork
Drag options to blanks, or click blank then click option'
Abridge
Boverlay
Chost
Dnone
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'overlay' requires a swarm setup and won't work for simple bridge networks.
4fill in blank
hard

Fill both blanks to run a container named 'db' attached to the 'backend' network and expose port 5432.

Docker
docker run -d --name db --network [1] -p [2]:5432 postgres
Drag options to blanks, or click blank then click option'
Abackend
Bfrontend
C5432
D3306
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 3306 is for MySQL, not PostgreSQL.
5fill in blank
hard

Fill all three blanks to create a user-defined bridge network named 'appnet', run a container named 'app' on it, and connect another container named 'worker' to the same network.

Docker
docker network [1] appnet && docker run -d --name app --network [2] nginx && docker network [3] appnet worker
Drag options to blanks, or click blank then click option'
Acreate
Bconnect
Cdisconnect
Drm
Eappnet
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'disconnect' or 'rm' will not create or connect networks properly.