Difference between revisions of "Docker images (command)"

From wikieduonline
Jump to navigation Jump to search
(Created page with " https://docs.docker.com/engine/reference/commandline/images/ <pre> $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE...")
 
Tags: Mobile web edit, Mobile edit
 
(43 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{lc}}
  
 +
[[List container images]]:
 +
* <code>docker images</code>
 +
* <code>docker images REPO_NAME</code>
 +
* <code>[[docker image ls]]</code>
 +
* <code>[[docker image list]]</code>
 +
* <code>[[docker images --digests]]</code>
 +
* <code>[[docker images --filter]]</code>
 
https://docs.docker.com/engine/reference/commandline/images/
 
https://docs.docker.com/engine/reference/commandline/images/
<pre>
 
$ docker images
 
  
REPOSITORY                TAG                IMAGE ID            CREATED            SIZE
+
Do not use <code>[[docker images ls]]</code> instead of <code>[[docker image ls]]</code> as you will not list any image as you will be listing images from a non existing repository: <code>ls</code>
<none>                    <none>              77af4d6b9913        19 hours ago        1.089 GB
+
 
committ                  latest              b6fa739cedf5        19 hours ago        1.089 GB
+
== Examples ==
<none>                    <none>              78a85c484f71        19 hours ago        1.089 GB
+
$ docker images
docker                    latest              30557a29d5ab        20 hours ago        1.089 GB
+
<none>                    <none>              5ed6274db6ce        24 hours ago        1.089 GB
+
REPOSITORY                [[TAG]]                 [[IMAGE ID]]           CREATED            SIZE
postgres                  9                  746b819f315e        4 days ago          213.4 MB
+
<none>                    <none>              77af4d6b9913        19 hours ago        1.089 GB
postgres                  9.3                746b819f315e        4 days ago          213.4 MB
+
committ                  latest              b6fa739cedf5        19 hours ago        1.089 GB  
postgres                  9.3.5              746b819f315e        4 days ago          213.4 MB
+
<none>                    <none>              78a85c484f71        19 hours ago        1.089 GB
postgres                  latest              746b819f315e        4 days ago          213.4 MB
+
docker                    latest              30557a29d5ab        20 hours ago        1.089 GB
</pre>
+
<none>                    <none>              5ed6274db6ce        24 hours ago        1.089 GB
 +
postgres                  9                  746b819f315e        4 days ago          213.4 MB
 +
postgres                  9.3                746b819f315e        4 days ago          213.4 MB
 +
postgres                  9.3.5              746b819f315e        4 days ago          213.4 MB
 +
postgres                  latest              746b819f315e        4 days ago          213.4 MB
  
 
Notes:
 
Notes:
* IMAGE ID column is the first 12 characters of the identifier for an image. You can create many tags of a given image (<code>[[DevOps/Docker/docker tag|docker tag]]</code><ref>https://docs.docker.com/engine/reference/commandline/tag/</ref>), but their IDs will all be the same, as example above.
+
* IMAGE ID column is the first 12 characters of the identifier for an image. You can create many tags of a given image (<code>[[docker tag]]</code><ref>https://docs.docker.com/engine/reference/commandline/tag/</ref>), but their IDs will all be the same, as example above.
 +
 
 +
* REPOSITORY column comes from the -t flag of the docker build command, or from docker tag-ing an existing image. You can tag images using your prefered nomenclature, but docker will use the tag as the [[registry]] location when using <code>[[docker push]]</code> or <code>[[docker pull]]</code>
 +
 
 +
 
 +
Images are stored in <code>[[docker info]] | grep "Docker Root Dir"</code><ref>https://stackoverflow.com/questions/19234831/where-are-docker-images-stored-on-the-host-machine</ref>
 +
:<code>DOCKER_ROOT_DIR/image/overlay2/imagedb/content</code>
 +
 
 +
 
 +
UNTAGGED IMAGES (DANGLING)
 +
docker images --filter "[[dangling]]=true"
 +
 
  
* REPOSITORY column comes from the -t flag of the docker build command, or from docker tag-ing an existing image. You can tag images using your prefered nomenclature, but docker will use the tag as the [[registry]] location when using <code>docker push</code> or <code>docker pull</code>
+
== Related commands ==
 +
* <code>[[docker system df]]</code> or <code>[[docker system df --verbose]]</code>
 +
* <code>[[docker-compose pull]]</code>
 +
* <code>[[docker-compose images]]</code>
 +
* <code>[[docker image ls]]</code>
 +
* <code>[[docker image prune]]</code>
 +
* <code>[[docker commit]]</code>
 +
* <code>[[docker image]]</code>
  
 
== See also ==
 
== See also ==
* [[DevOps/Container Registry]]
+
* {{docker images}}
 +
* {{docker image}}
 +
* {{docker images management}}
  
  

Latest revision as of 06:04, 20 September 2022

List container images:

https://docs.docker.com/engine/reference/commandline/images/

Do not use docker images ls instead of docker image ls as you will not list any image as you will be listing images from a non existing repository: ls

Examples[edit]

$ docker images

REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
<none>                    <none>              77af4d6b9913        19 hours ago        1.089 GB
committ                   latest              b6fa739cedf5        19 hours ago        1.089 GB 
<none>                    <none>              78a85c484f71        19 hours ago        1.089 GB
docker                    latest              30557a29d5ab        20 hours ago        1.089 GB
<none>                    <none>              5ed6274db6ce        24 hours ago        1.089 GB
postgres                  9                   746b819f315e        4 days ago          213.4 MB
postgres                  9.3                 746b819f315e        4 days ago          213.4 MB
postgres                  9.3.5               746b819f315e        4 days ago          213.4 MB
postgres                  latest              746b819f315e        4 days ago          213.4 MB

Notes:

  • IMAGE ID column is the first 12 characters of the identifier for an image. You can create many tags of a given image (docker tag[1]), but their IDs will all be the same, as example above.
  • REPOSITORY column comes from the -t flag of the docker build command, or from docker tag-ing an existing image. You can tag images using your prefered nomenclature, but docker will use the tag as the registry location when using docker push or docker pull


Images are stored in docker info | grep "Docker Root Dir"[2]

DOCKER_ROOT_DIR/image/overlay2/imagedb/content


UNTAGGED IMAGES (DANGLING)

docker images --filter "dangling=true" 


Related commands[edit]

See also[edit]

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

Original Source: https://en.wikiversity.org/wiki/DevOps/Docker/docker_images

Advertising: