docker images
The docker images command is used to list all the images on your local Docker host. It provides information about the images, such as their repository, tag, image ID, creation date, and size.
Basic Syntax
Key Options and Parameters
-a, --all: Show all images (default hides intermediate images).
docker images -a--digests: Show digests.
docker images --digests-q, --quiet: Only show numeric IDs.
docker images -q--filter: Filter output based on conditions provided.
docker images --filter "dangling=true"--format: Pretty-print images using a Go template.
docker images --format "{{.Repository}}: {{.Tag}}"
Examples
List All Images
docker imagesThis command lists all images on the local Docker host.
List All Images Including Intermediate Images
docker images -aThis command lists all images, including intermediate images used in the build process.
List Only Image IDs
docker images -qThis command lists only the IDs of all images.
Filter Images by Dangling Status
docker images --filter "dangling=true"This command lists only the images that are not tagged and are not referenced by any container.
Show Digests
docker images --digestsThis command lists images along with their digests.
Format Output
docker images --format "{{.Repository}}: {{.Tag}}"This command formats the output to show only the repository and tag of each image.
Conclusion
The docker images command is useful for managing and inspecting Docker images on your local host. Understanding its options and parameters allows you to effectively list and filter images based on your needs.