docker images

Command Name: 

docker images

Description:

docker images lists all the images

Syntax:

easywhatis$ docker images --help

Usage: docker images [OPTIONS] [REPOSITORY[:TAG]]

List images

Options:
  -a, --all             Show all images (default hides intermediate images)
      --digests         Show digests
  -f, --filter filter   Filter output based on conditions provided
      --format string   Pretty-print images using a Go template
      --no-trunc        Don't truncate output
  -q, --quiet           Only show numeric IDs
easywhatis$

Example:

List all images:

docker images

easywhatis$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
busybox             3                   83aa35aa1c79        3 weeks ago         1.22MB
busybox             latest              83aa35aa1c79        3 weeks ago         1.22MB

List images by name:

docker images <<tomcat>>

easywhatis$ docker images tomcat
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
easywhatis$ docker images busybox
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
busybox             3                   83aa35aa1c79        3 weeks ago         1.22MB
busybox             latest              83aa35aa1c79        3 weeks ago         1.22M

List images by name and tag:

docker images <<tomcat>>:<>

easywhatis$ docker images busybox:3
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
busybox             3                   83aa35aa1c79        3 weeks ago         1.22MB

List the full length image IDs:

docker images —no-trunc

REPOSITORY          TAG                 IMAGE ID                                                                  CREATED             SIZE
busybox             3                   sha256:83aa35aa1c79e4b6957e018da6e322bfca92bf3b4696a211b42502543c242d6f   3 weeks ago         1.22MB
busybox             latest              sha256:83aa35aa1c79e4b6957e018da6e322bfca92bf3b4696a211b42502543c242d6f   3 weeks ago         1.22MB

List image digests:

docker images –digests

easywhatis$ docker images --digests
REPOSITORY          TAG                 DIGEST              IMAGE ID            CREATED             SIZE
busybox             3                                 83aa35aa1c79        3 weeks ago         1.22MB
busybox             latest                            83aa35aa1c79        3 weeks ago         1.22MB

Show Untagged Images (Dangling)

docker images –filter “dangling=true”

easywhatis$ docker images --filter "dangling=true"
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

Remove all dangling images:

docker rmi $(docker images -f “dangling=true” -q)

Remove all images those are present on system:

easywhatis$ docker rmi $(docker images -a -q)
Untagged: busybox:latest
Untagged: busybox@sha256:b26cd013274a657b86e706210ddd5cc1f82f50155791199d29b9e86e935ce135
Deleted: sha256:83aa35aa1c79e4b6957e018da6e322bfca92bf3b4696a211b42502543c242d6f
Deleted: sha256:a6d503001157aedc826853f9b67f26d35966221b158bff03849868ae4a821116
easywhatis$
easywhatis$
easywhatis$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
easywhatis$