Skip to content
Latchkey

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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →