0
0
Dockerdevops~20 mins

Inspecting container details in Docker - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Container Inspector Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
Inspecting container IP address
You run the command docker inspect -f '{{ .NetworkSettings.IPAddress }}' mycontainer. What is the expected output?
Docker
docker inspect -f '{{ .NetworkSettings.IPAddress }}' mycontainer
AShows the container's mounted volumes
BShows the container's image ID
CShows the IP address assigned to the container named 'mycontainer'
DShows the container's creation date
Attempts:
2 left
💡 Hint
The command uses a Go template to extract network info.
🧠 Conceptual
intermediate
1:00remaining
Understanding docker inspect output format
What does the docker inspect command output by default?
AA JSON array with detailed information about the container or image
BA plain text summary of container logs
CA list of running processes inside the container
DThe container's resource usage statistics
Attempts:
2 left
💡 Hint
Think about the data format used for detailed info.
Troubleshoot
advanced
1:30remaining
Troubleshooting missing container details
You run docker inspect mycontainer but get an error: Error: No such object: mycontainer. What is the most likely cause?
ADocker daemon is not running
BYou do not have permission to run docker commands
CThe docker inspect command syntax is incorrect
DThe container named 'mycontainer' does not exist or is not running
Attempts:
2 left
💡 Hint
Check if the container name is correct and exists.
Best Practice
advanced
2:00remaining
Extracting specific container info efficiently
Which command is best to get only the container's mount points using docker inspect?
Adocker inspect mycontainer | grep Mounts
Bdocker inspect -f '{{ json .Mounts }}' mycontainer
Cdocker inspect -f '{{ .Config.Mounts }}' mycontainer
Ddocker inspect --format '{{ .HostConfig.Mounts }}' mycontainer
Attempts:
2 left
💡 Hint
Use the correct Go template field and format for mounts.
🔀 Workflow
expert
2:30remaining
Sequence to find container's exposed ports
Arrange the steps to find the exposed ports of a container named 'webapp' using docker commands.
A1,3,2,4
B1,2,3,4
C3,1,2,4
D2,1,3,4
Attempts:
2 left
💡 Hint
First get details, then extract with template, then interpret.