List and inspect local Docker images
Quick answer
docker image ls summarizes the local image inventory. docker image inspect exposes structured metadata for a selected image, including configuration and platform information.
How it works
Use a repository filter or --digests for inventory. For targeted inspection, --format selects a field instead of dumping all metadata. A single image can have multiple tags, and different images can share layers. Adding all displayed sizes is not a reliable measure of actual disk usage.
Lab prerequisites
Use only a disposable approved Linux-container Docker context. Confirm the active context with docker context show before any mutation. The instructor must preload and review busybox:1.37 for the target platform and record its digest. The tag is a fixture convention inherited from earlier chapters, not a verified immutable version. Commands are static examples, not executed by ByteMind. Before any engine request, confirm the effective approved daemon endpoint, including DOCKER_HOST, DOCKER_CONTEXT and CLI overrides; do this privately in each terminal. Confirm the local tag still resolves to the approved image identity and platform. If any check fails, use the paper exercise instead.
Command example
docker image ls --digests busybox:1.37docker image inspect --format '{{.Os}}/{{.Architecture}}' busybox:1.37docker image inspect --format '{{json .Config.Cmd}}' busybox:1.37docker image inspect --format '{{json .Config.Entrypoint}}' busybox:1.37Expect an inventory row for the preloaded fixture, its selected OS/architecture (for example linux/amd64), and the configured default command as JSON. Exact values depend on the approved image. These are image defaults, not a running container’s actual process. Config.Cmd supplies default command arguments; Config.Entrypoint, when set, also contributes to the eventual invocation. Do not infer the complete command from Cmd alone.
Common mistakes
Inspecting an image is not a security audit. Avoid printing full metadata from private images because configuration can contain sensitive information.
Manual practice
Identify the local image platform and command defaults. Explain why the inventory alone cannot tell which containers are currently running.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
List and inspect local Docker images — Knowledge check
Apply the concepts from this lesson.
Which command retrieves image configuration?
Why not add all displayed image sizes?
Does Config.Cmd report the actual process in every container?