docker images Command Reference
List images in the local store.
docker images shows images held locally, with repository, tag, ID, age, and size. In CI it is mostly used in scripts with -q and --format to feed image IDs into other commands or to assert that a build produced the expected tags.
Common flags
-q, --quiet- output only image IDs-a, --all- include intermediate images--filter- filter results, e.g. dangling=true or reference='myorg/*'--format- Go template output, e.g. "{{.Repository}}:{{.Tag}}"--digests- show image digests
Example
shell
docker images --format "{{.Repository}}:{{.Tag}} {{.Size}}"
docker rmi $(docker images -q --filter "dangling=true")In CI
Use --format to assert a build produced expected tags, and -q --filter dangling=true to collect untagged leftover layers for cleanup with docker rmi. Scripting against IDs avoids parsing the human-readable table columns.
Key takeaways
- -q emits bare image IDs for piping into rmi or other commands.
- --filter dangling=true finds untagged layers to reclaim disk.
- --format produces stable, scriptable output instead of the table view.
Related guides
docker rmi Command ReferenceReference for docker rmi in CI: remove one or more images with -f to reclaim disk on runners and clear dangli…
docker system prune Command ReferenceReference for docker system prune in CI: reclaim disk by removing stopped containers, unused networks, dangli…
docker history Command ReferenceReference for docker history in CI: show the layers of an image with sizes and creating instructions to debug…