How to List the SHA Digest of Docker Images


In order to get the digest of an image i.e. the SHA256 hash of the image, you can make use of the option --digests along with the docker images command,


# docker images --digests

REPOSITORY    TAG       DIGEST                                                                    IMAGE ID       CREATED        SIZE
ubuntu        latest    sha256:4b1d0c4a2d2aaf63b37111f34eb9fa89fa1bf53dd6e4ca954d47caebca4005c2   3c2df5585507   6 days ago     69.2MB
amazonlinux   latest    sha256:f0ad031d65bf6cd219d8621d2a304d884c6a809ca2b20855eac371df92f4fcaf   5514655128c4   13 days ago    194MB
alpine        latest    sha256:bc41182d7ef5ffc53a40b044e725193bc10142a1243f395ee852a8d9730fc2ad   a6215f271958   3 months ago   5.29MB

As you can see, when I used the --digests option, the digest column is made available with 64 characters long sha256 digest of the images.


Images Sha Digest using Docker Command
-


Have Questions? Post them here!

Topics Coverage:


🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.

Follow Us: GitHub | Facebook | Twitter | Instagram