0
0
Dockerdevops~5 mins

Docker inspect for detailed info - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the docker inspect command do?
It shows detailed low-level information about Docker objects like containers, images, volumes, or networks in JSON format.
Click to reveal answer
beginner
How can you use docker inspect to get information about a running container?
Run docker inspect <container_name_or_id> to see detailed info such as IP address, mounts, environment variables, and more.
Click to reveal answer
beginner
What format does docker inspect output its information in?
It outputs information in JSON format, which is easy to read and can be parsed by other tools.
Click to reveal answer
intermediate
How do you extract a specific piece of information, like the IP address, from docker inspect output?
Use the --format option with a Go template, for example: docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container>.
Click to reveal answer
beginner
Can docker inspect be used on Docker images?
Yes, you can inspect images by running docker inspect <image_name_or_id> to see metadata like layers, size, and creation time.
Click to reveal answer
What is the primary output format of the docker inspect command?
AXML
BYAML
CJSON
DPlain text
Which command shows the IP address of a container named webapp?
Adocker show ip webapp
Bdocker ip webapp
Cdocker info webapp
Ddocker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' webapp
Can docker inspect be used to get details about Docker volumes?
AYes
BNo
COnly for named volumes
DOnly for volumes attached to containers
What kind of information can you NOT get from docker inspect?
AContainer logs
BContainer IP address
CImage creation time
DContainer environment variables
Which of these commands will show detailed info about a Docker image named nginx?
Adocker logs nginx
Bdocker inspect nginx
Cdocker ps nginx
Ddocker run nginx
Explain how to use docker inspect to find the IP address of a running container.
Think about how to filter JSON output to get just the IP.
You got /5 concepts.
    Describe what kind of information you can get from docker inspect for a Docker image.
    Focus on image details, not container runtime info.
    You got /5 concepts.