.nh .TH "DOCKER" "1" "Jan 2024" "Docker Community" "Docker User Manuals" .SH NAME .PP docker-image-ls - List images .SH SYNOPSIS .PP \fBdocker image ls [OPTIONS] [REPOSITORY[:TAG]]\fP .SH DESCRIPTION .PP This command lists the images stored in the local Docker repository. .PP By default, intermediate images, used during builds, are not listed. Some of the output, e.g., image ID, is truncated, for space reasons. However the truncated image ID, and often the first few characters, are enough to be used in other Docker commands that use the image ID. The output includes repository, tag, image ID, date created and the virtual size. .PP The title REPOSITORY for the first title may seem confusing. It is essentially the image name. However, because you can tag a specific image, and multiple tags (image instances) can be associated with a single name, the name is really a repository for all tagged images of the same name. For example consider an image called ubuntu. It may be tagged with 20.04 or 22.04, etc. to manage different versions. .SH Filters .PP Filters the output based on these conditions: .RS .IP \(bu 2 dangling=(true|false) - find unused images .IP \(bu 2 label= or label== .IP \(bu 2 before=([:tag]||image@digest \[la]mailto:image@digest\[ra]) .IP \(bu 2 since=([:tag]||image@digest \[la]mailto:image@digest\[ra]) .IP \(bu 2 reference=(pattern of an image reference) .RE .SH Format .PP Pretty-print images using a Go template. Valid placeholders: .ID - Image ID .Repository - Image repository .Tag - Image tag .Digest - Image digest .CreatedSince - Elapsed time since the image was created .CreatedAt - Time when the image was created .Size - Image disk size .SH EXAMPLES .SH Listing the images .PP To list the images in a local repository (not the registry) run: .EX docker image ls .EE .PP The list will contain the image repository name, a tag for the image, and an image ID, when it was created and its virtual size. Columns: REPOSITORY, TAG, IMAGE ID, CREATED, and SIZE. .PP The \fBdocker image ls\fR command takes an optional \fB[REPOSITORY[:TAG]]\fR argument that restricts the list to images that match the argument. If you specify \fBREPOSITORY\fR but no \fBTAG\fR, the \fBdocker image ls\fR command lists all images in the given repository. .EX docker image ls java .EE .PP The \fB[REPOSITORY[:TAG]]\fR value must be an "exact match". This means that, for example, \fBdocker image ls jav\fR does not match the image \fBjava\fR\&. .PP If both \fBREPOSITORY\fR and \fBTAG\fR are provided, only images matching that repository and tag are listed. To find all local images in the "java" repository with tag "8" you can use: .EX docker image ls java:8 .EE .PP To get a verbose list of images which contains all the intermediate images used in builds use \fB-a\fP: .EX docker image ls -a .EE .PP Previously, the docker image ls command supported the --tree and --dot arguments, which displayed different visualizations of the image data. Docker core removed this functionality in the 1.7 version. If you liked this functionality, you can still find it in the third-party dockviz tool: https://github.com/justone/dockviz. .SH Listing images in a desired format .PP When using the --format option, the image command will either output the data exactly as the template declares or, when using the \fBtable\fR directive, will include column headers as well. You can use special characters like \fB\\t\fR for inserting tab spacing between columns. .PP The following example uses a template without headers and outputs the ID and Repository entries separated by a colon for all images: .EX docker images --format "{{.ID}}: {{.Repository}}" 77af4d6b9913: b6fa739cedf5: committ 78a85c484bad: ipbabble 30557a29d5ab: docker 5ed6274db6ce: 746b819f315e: postgres 746b819f315e: postgres 746b819f315e: postgres 746b819f315e: postgres .EE .PP To list all images with their repository and tag in a table format you can use: .EX docker images --format "table {{.ID}}\\t{{.Repository}}\\t{{.Tag}}" IMAGE ID REPOSITORY TAG 77af4d6b9913 b6fa739cedf5 committ latest 78a85c484bad ipbabble 30557a29d5ab docker latest 5ed6274db6ce 746b819f315e postgres 9 746b819f315e postgres 9.3 746b819f315e postgres 9.3.5 746b819f315e postgres latest .EE .PP Valid template placeholders are listed above. .SH Listing only the shortened image IDs .PP Listing just the shortened image IDs. This can be useful for some automated tools. .EX docker image ls -q .EE .SH OPTIONS .PP \fB-a\fP, \fB--all\fP[=false] Show all images (default hides intermediate images) .PP \fB--digests\fP[=false] Show digests .PP \fB-f\fP, \fB--filter\fP= Filter output based on conditions provided .PP \fB--format\fP="" Pretty-print images using a Go template .PP \fB-h\fP, \fB--help\fP[=false] help for ls .PP \fB--no-trunc\fP[=false] Don't truncate output .PP \fB-q\fP, \fB--quiet\fP[=false] Only show image IDs .SH SEE ALSO .PP \fBdocker-image(1)\fP