0
0
Dockerdevops~20 mins

Listing local images in Docker - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Docker Image Listing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of the command to list all local Docker images?
You run the command docker images on a system with three images: alpine:latest, ubuntu:20.04, and nginx:1.21. What will the command output show?
Docker
docker images
A
REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
alpine       latest    abc123def456   2 weeks ago    5.5MB
ubuntu       20.04     def456abc123   3 weeks ago    72.9MB
nginx        1.21      123abc456def   1 week ago     133MB
B
REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
alpine       latest    abc123def456   2 weeks ago    5.5MB
ubuntu       20.04     def456abc123   3 weeks ago    72.9MB
C
REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
nginx        1.21      123abc456def   1 week ago     133MB
D
REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
none         none      none          none           none
Attempts:
2 left
💡 Hint
The docker images command lists all local images with their tags and sizes.
🧠 Conceptual
intermediate
2:00remaining
Which Docker command lists only image IDs of local images?
You want to see just the image IDs of all local Docker images without other details. Which command will do this?
Adocker images --format "{{.ID}}"
Bdocker images --ids
Cdocker list images --id-only
Ddocker images -q --all
Attempts:
2 left
💡 Hint
Use the --format option with a Go template to customize output.
Troubleshoot
advanced
2:00remaining
Why does docker images show no images after pulling one?
You run docker pull nginx successfully, but then docker images shows no images. What could cause this?
AThe image pull failed silently and no image was downloaded.
BYou are connected to a different Docker context or daemon than where the image was pulled.
CDocker images command requires sudo privileges to show images.
DThe image was pulled but immediately deleted by a cleanup process.
Attempts:
2 left
💡 Hint
Check if Docker is using the same context or daemon for both commands.
🔀 Workflow
advanced
2:00remaining
What is the correct sequence to list images, remove one, then verify removal?
You want to list all images, remove the image with ID abc123, then confirm it is removed. Which sequence of commands is correct?
A2,1,3
B1,3,2
C1,2,3
D3,1,2
Attempts:
2 left
💡 Hint
You must list images first to see what is available before removing.
Best Practice
expert
2:00remaining
Which command safely lists all local images including intermediate layers?
You want to see all local Docker images including intermediate layers that are not tagged. Which command achieves this?
Adocker images --include-untagged
Bdocker images --filter intermediate=true
Cdocker images --show-intermediate
Ddocker images --all
Attempts:
2 left
💡 Hint
Use the option that shows all images, not just tagged ones.