0
0
Dockerdevops~20 mins

Why container networking matters in Docker - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Container Networking Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Why do containers need networking?

Which of the following best explains why container networking is important?

AContainers use networking only to access the host's file system.
BContainers use networking only to download images from Docker Hub.
CNetworking is not needed because containers run isolated and never interact.
DContainers need networking to communicate with each other and external systems.
Attempts:
2 left
💡 Hint

Think about how multiple containers work together in an application.

💻 Command Output
intermediate
2:00remaining
Inspecting Docker container network settings

What is the output of the following command if a container named webapp is running and connected to the default bridge network?

Docker
docker inspect -f '{{json .NetworkSettings.Networks }}' webapp
A{"bridge":{"IPAMConfig":null,"Links":null,"Aliases":null,"NetworkID":"abc123","EndpointID":"def456","Gateway":"172.17.0.1","IPAddress":"172.17.0.2","IPPrefixLen":16,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAddress":"02:42:ac:11:00:02","DriverOpts":null}}
BError: No such container: webapp
C{}
D{"host":{}}
Attempts:
2 left
💡 Hint

The default Docker network is called bridge and containers get an IP in the 172.17.0.0/16 range.

🔀 Workflow
advanced
2:30remaining
Connecting two containers on a user-defined network

You want two containers, app1 and app2, to communicate securely. Which sequence of commands correctly creates a user-defined network and runs both containers attached to it?

A3,2,1
B1,2,3
C1,3,2
D2,1,3
Attempts:
2 left
💡 Hint

Create the network first, then run containers attached to it.

Troubleshoot
advanced
2:00remaining
Diagnosing container communication failure

Two containers on the same user-defined network cannot ping each other by container name. What is the most likely cause?

AThe containers are running on different Docker hosts without overlay network.
BThe containers are using the default bridge network which supports automatic DNS resolution.
CThe containers have no IP addresses assigned.
DThe containers are not attached to the same user-defined network.
Attempts:
2 left
💡 Hint

Think about multi-host container networking and DNS resolution.

Best Practice
expert
2:00remaining
Choosing the right Docker network driver for microservices

For a microservices app deployed on multiple Docker hosts, which network driver is best to enable secure, scalable container communication?

Abridge
Bhost
Coverlay
Dnone
Attempts:
2 left
💡 Hint

Consider multi-host networking and service discovery.