0
0
Dockerdevops~20 mins

Network inspection and debugging in Docker - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Network Debugging Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Inspect Docker container network details
You run the command docker network inspect bridge. What key information does this command provide about the Docker bridge network?
AIt displays the CPU and memory usage of all running containers.
BIt shows the containers connected to the bridge network, their IP addresses, and network settings.
CIt lists all Docker images available on the host machine.
DIt removes the bridge network and disconnects all containers.
Attempts:
2 left
💡 Hint
Think about what 'inspect' means in Docker networking context.
💻 Command Output
intermediate
2:00remaining
Diagnose container connectivity with ping
You have two containers on the same user-defined Docker network. You run docker exec container1 ping -c 3 container2. What output do you expect if the network is correctly configured?
A3 packets transmitted, 3 received, 0% packet loss, time=XYZ ms
Bping: unknown host container2
CPermission denied
Dconnect: Network is unreachable
Attempts:
2 left
💡 Hint
Successful ping means packets reach the target container.
Troubleshoot
advanced
2:30remaining
Troubleshoot Docker container cannot reach external internet
A container cannot access the internet, but other containers on the same host can. Which Docker network setting is most likely causing this?
AThe container is connected to a user-defined bridge network without proper DNS or gateway settings.
BThe container is running with the <code>--network host</code> option.
CThe container has <code>--restart always</code> set.
DThe container is using a volume mount for /etc/hosts.
Attempts:
2 left
💡 Hint
Check network isolation and DNS configuration.
Best Practice
advanced
2:30remaining
Best practice for inspecting live network traffic of a container
You want to capture and analyze live network traffic inside a running Docker container. Which approach is best?
AModify the container's Dockerfile to add network capture tools and rebuild.
BRestart the container with <code>--net=host</code> to capture traffic on the host.
CUse <code>docker logs</code> to view network packets.
DUse <code>docker exec</code> to run <code>tcpdump</code> inside the container if installed.
Attempts:
2 left
💡 Hint
Think about capturing traffic without restarting or rebuilding.
🔀 Workflow
expert
3:00remaining
Order the steps to debug a Docker container network issue
Arrange these steps in the correct order to debug why a Docker container cannot connect to another container on the same network.
A1,3,2,4
B2,1,3,4
C1,2,3,4
D3,1,2,4
Attempts:
2 left
💡 Hint
Start with network configuration, then test connectivity, then check host settings, then logs.