How to List All Docker Images on Your System
Listing all Docker images on your system is a straightforward process that allows you to see what images are available for use. This can be helpful for managing your images, checking for outdated versions, or simply verifying that your images have been built successfully. In this guide, we will explain how to list Docker images using the command line.
1. Prerequisites
Before you can list Docker images, ensure that you have the following:
- Docker Installed: Make sure Docker is installed and running on your machine. You can download it from the official Docker website.
- Access to the Command Line: You should be comfortable using the command line or terminal on your operating system.
2. Using the Docker CLI to List Images
To list all Docker images on your system, you can use the docker images
command. This command provides a summary of all images stored in your local Docker environment.
Basic Command
Open your terminal or command prompt and run the following command:
docker images
Understanding the Output
When you run the docker images
command, you will see output similar to the following:
REPOSITORY TAG IMAGE ID CREATED SIZE
my-node-app latest 123abc456def 2 days ago 150MB
ubuntu 20.04 789xyz123abc 3 weeks ago 64.2MB
nginx latest 456def789abc 1 month ago 133MB
The output includes several columns:
- REPOSITORY: The name of the image repository.
- TAG: The tag associated with the image, which is often used to specify the version.
- IMAGE ID: A unique identifier for the image.
- CREATED: The date and time when the image was created.
- SIZE: The size of the image on disk.
3. Additional Options
You can also use additional options with the docker images
command to customize the output:
Listing All Images Including Intermediate Images
To include intermediate images in the output, use the -a
option:
docker images -a
Filtering Images by Repository
If you want to filter the images by a specific repository, you can use the --filter
option:
docker images --filter=reference='my-node-app:*'
4. Conclusion
Listing all Docker images on your system is a simple yet essential task for managing your Docker environment. By using the docker images
command, you can easily view the images available for use, check their sizes, and verify their creation dates. Understanding how to list and manage your Docker images is crucial for effective containerization and application deployment.