How to List Docker Images

29/12/2020
Docker is an open source containerization system. Docker images are basically a base layout from which containers are created. To create Docker containers of different Linux distributions or apps, you have to use different Docker images. Once you create a container using a specific Docker image, the image is downloaded and stored locally on your Docker host. Overtime, you will end up with a lot of local copies of Docker images on your Docker host.

In this article, I will show you how to list all the locally stored Docker images on your Docker host. So, let’s get started.

Requirements:

You must have Docker installed on your computer if you want to try out the examples in this article.

If you don’t have Docker installed, then you may check out one of the articles below (depending on your operating system) to get Docker installed on your desired Linux distribution.

If you still have any problem installing Docker, you may contact me through https://support.linuxhint.com. I will be more than happy to help.

Listing Locally Stored Docker Images:

To list all the locally stored Docker images, you can run the following command:

$ docker image list

As you can see, all the locally stored Docker images are listed. You can see the repository name, tag, short image ID, date of creation and size of the locally stored Docker images.

The short image ID is enough to distinguish between the Docker images uniquely. But if you prefer the long image ID, you can use the –no-trunc option with the previous command.

To list the locally stored Docker images along with the long image ID, run the following command:

$ docker image list –no-trunc

As you can see, the long sha256 format of the image ID is displayed.

Listing Docker Intermediary or Bad Images:

Docker intermediary images has the repository and tag name <none>:<none>. These are basically unused Docker images. They don’t have any importance. You should remove them occasionally.

To list all the unused Docker images on your Docker host, run the following command:

$ docker image list –filter dangling=true

As you can see, all the unused Docker images along with their image ID, creation date, size are listed.

Listing Only Docker Image IDs:

At times, you may only need a list of image IDs of the locally stored Docker images on your Docker host. This is very important for scripting purpose and for removing Docker images.

To list only the image IDs of the unused Docker images on your Docker host, run the following command:

$ docker image list –quiet –filter dangling=true

As you can see, only the image ID of the unused Docker images are listed.

To list all the image IDs of the good Docker images, run the following command:

$ docker image list –quiet –filter dangling=false

As you can see, only the image ID of the good Docker images are listed.

So, that’s how you list locally stored Docker images on your Docker host. Thanks for reading this article.

Sandclock IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, Sandclock IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

Storing and Sharing with Docker Volumes

In Docker, you can write data on the writable layer. But the data doesn’t persist after a container shuts down. Also,...
28/12/2020

How to List Docker Images

Docker is an open source containerization system. Docker images are basically a base layout from which containers are created....
29/12/2020

Installing Docker on Debian 10

In this article, I am going to show you how to install the latest Docker CE (Community Edition) on Debian 10 Buster. So,...
29/12/2020
Bài Viết

Bài Viết Mới Cập Nhật

Hướng dẫn chuyển đổi windows server windows evaluation to standard và active windows server 2008 + 2012 + 2016 + 2019
26/10/2021

How to Update Ubuntu Linux
24/10/2021

Squid Proxy Manager cài đặt và quản lý Proxy Squid tự động trên ubuntu
20/10/2021

Hướng dẫn cài đặt Apache CloudStack 4.15.2.0
19/10/2021

Hướng dẫn ký file PDF bằng chữ ký số (chữ ký điện tử) và sửa lỗi mới nhất 2021 foxit reader
19/10/2021