0
0
Dockerdevops~5 mins

Inspecting container details in Docker - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What command shows detailed information about a specific Docker container?
The command docker inspect <container_id_or_name> shows detailed JSON-formatted information about the container's configuration and state.
Click to reveal answer
beginner
What kind of information can you find using docker inspect?
You can find container ID, image used, network settings, mount points, environment variables, state (running, exited), ports, and more.
Click to reveal answer
intermediate
How do you get just the IP address of a running container using Docker commands?
Use docker inspect -f '{{ .NetworkSettings.Networks.<network>.IPAddress }}' <container_id_or_name> to get only the container's IP address.
Click to reveal answer
intermediate
What does the -f or --format option do in docker inspect?
It allows you to format the output using a Go template to extract specific fields instead of the full JSON output.
Click to reveal answer
beginner
Why is inspecting container details useful in troubleshooting?
Inspecting helps you understand the container's setup, network, volumes, and state, which can reveal misconfigurations or issues causing failures.
Click to reveal answer
Which command shows detailed JSON info about a Docker container?
Adocker inspect <container>
Bdocker ps
Cdocker logs <container>
Ddocker run <container>
How to get only the IP address of a container?
Adocker logs <container>
Bdocker inspect -f '{{ .NetworkSettings.Networks.<network>.IPAddress }}' <container>
Cdocker ps -a
Ddocker exec <container> ip addr
What does docker inspect NOT show?
AContainer mount points
BContainer network settings
CContainer environment variables
DContainer logs
Which option formats the output of docker inspect?
A-f or --format
B-q or --quiet
C-a or --all
D-l or --latest
Why inspect container details?
ATo delete a container
BTo start a new container
CTo understand container setup and troubleshoot issues
DTo build a Docker image
Explain how to use docker inspect to find the IP address of a container.
Think about formatting output to get just the IP.
You got /4 concepts.
    Describe what kind of information you can learn by inspecting a Docker container.
    Consider what helps in troubleshooting container issues.
    You got /5 concepts.