Docker Images Command
[Docker Command Manual](#)
* * *
The `docker images` command is used to list local Docker images.
Through the `docker images` command, users can view detailed information about all downloaded or built Docker images, such as repository names, tags, image IDs, creation times, and sizes.
### Syntax
docker images [REPOSITORY[:TAG]]
OPTIONS Description:
* **`-a, --all`**: Show all images (including intermediate images).
* **`--digests`**: Show image digests.
* **`-f, --filter`**: Filter output based on provided conditions.
* **`--format`**: Format output using Go templates.
* **`--no-trunc`**: Show the complete image ID.
* **`-q, --quiet`**: Only show image IDs.
List all local images:
docker images
List images with digest information:
docker images --digests
List all images (including intermediate images):
docker images --all
List images using filter conditions:
docker images --filter "dangling=true"
Only show image IDs:
docker images --quiet
Output using a custom format:
docker images --format "table {{.Repository}}t{{.Tag}}t{{.ID}}t{{.Size}}"
### Examples
View the local image list:
tutorial@tutorial:~$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE mymysql v1 37af1236adef 5 minutes ago 329 MB tutorial/ubuntu v4 1c06aa18edee 2 days ago 142.1 MB 5c6e1090e771 2 days ago 165.9 MB httpd latest ed38aaffef30 11 days ago 195.1 MB alpine latest 4e38e38c8ce0 2 weeks ago 4.799 MB mongo 3.2 282fd552add6 3 weeks ago 336.1 MB redis latest 4465e4bcad80 3 weeks ago 185.7 MB php 5.6-fpm 025041cd3aa5 3 weeks ago 456.3 MB python 3.5 045767ddf24a 3 weeks ago 684.1 MB ...
List images where the REPOSITORY is ubuntu:
root@tutorial:~# docker images ubuntu REPOSITORY TAG IMAGE ID CREATED SIZE ubuntu 14.04 90d5884b1ee0 9 weeks ago 188 MB ubuntu 15.10 4e3b13c8a266 3 months ago 136.3 MB
Output with digest information:
docker images --digests
Output:
REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE ubuntu latest sha256:8c53f09a9c6f1e85e10a8ffb649dd9de28b9be4994e792bd96fca152527bba03 2d13d07a40a3 2 weeks ago 72.9MB nginx stable sha256:1c4f40db5d1c8e5e09d28e501ad167d7c2d91b8908f6f1d9c97d1c67c5f9a69b 5a34e9e5d33b 3 weeks ago 133MB hello-world latest sha256:feda4427b0b5d9d84545dcb38e736a5226e5bb6228c61b0b6b28cb7483a14b68 feb5d9fea6a5 4 weeks ago 13.3kB
Output using filter conditions:
docker images --filter "dangling=true"
Example output:
REPOSITORY TAG IMAGE ID CREATED SIZE 7db03500db4f 5 weeks ago 65.3MB
Custom format output:
docker images --format "table {{.Repository}}t{{.Tag}}t{{.ID}}t{{.Size}}"
Output:
REPOSITORY TAG IMAGE ID SIZE ubuntu latest 2d13d07a40a3 72.9MB nginx stable 5a34e9e5d33b 133MB hello-world latest feb5d9fea6a5 13.3kB
### Common Scenarios
* **Managing Images**: List local images to understand the currently available images.
* **Filtering Images**: Use filter options to find images that meet specific conditions, such as dangling images (untagged images).
* **Image ID Management**: Retrieve only image IDs for subsequent operations, such as deleting images.
The `docker images` command is a very fundamental and important command in Docker image management. Through this command, users can view detailed information about all local images, and perform image management and maintenance. Using various options and formats, the output can be flexibly filtered and formatted to meet different management needs.
* * Docker Command Manual](#)
YouTip