0

Is that possible to search docker images by sha256?

Suppose that nginx:latest and nginx:stable-alpine-perl are the same image (I mean if I pull nginx:latest, it has perl inside too (let us suppose) with the following output:

root@saeed:/# docker pull nginx:stable-alpine-perl
stable-alpine-perl: Pulling from library/nginx
8663204ce13b: Pull complete
d953079a3046: Pull complete
ea6555c01322: Pull complete
cbc136171839: Pull complete
d0f7b76a6d37: Pull complete
8f7ff84fa6b0: Pull complete
Digest: sha256:a20f8020221340e9fa8f83b4d8e611b04d34731b36dfa8528c5bc45066d3ecce
Status: Downloaded newer image for nginx:stable-alpine-perl
docker.io/library/nginx:stable-alpine-perl
root@saeed:/# docker images --digests | grep nginx | grep a20f8020221340e9fa8f83b4d8e611b04d34731b36dfa8528c5bc45066d3ecce
nginx                                 stable-alpine-perl   sha256:a20f8020221340e9fa8f83b4d8e611b04d34731b36dfa8528c5bc45066d3ecce   40b7e6d681dd   3 weeks ago     57.8MB

The current version is 1.20.2.

Suppose around two months later I want to check what image I did exactly pull.

The only information I have is sha256:a20f8020221340e9fa8f83b4d8e611b04d34731b36dfa8528c5bc45066d3ecce, but two months later's nginx:latest's sha256 is different.

Is there a way to search and find images by sha256?

I searched but found nothing unfortunately.

Saeed
  • 2,040
  • 4
  • 11
  • 27
  • What exactly do you mean by "search"? You can specify a hash and get e.g. the tags assigned to that image just like you can with the image's name. – tripleee May 03 '22 at 06:45
  • Possible duplncate of https://stackoverflow.com/questions/56646899/how-to-find-all-image-tags-of-a-running-docker-container – tripleee May 03 '22 at 06:46
  • @tripleee suppose I have an image with `sha256:256chars` tagged as `nothing:unknow`. I want to search `sha256:256chars` in docker hub to see if it's an image there. – Saeed May 03 '22 at 07:36
  • @tripleee thanks, but the link you provided is to search via `docker images` in local server, but I want to search in docker hub server. – Saeed May 03 '22 at 07:37
  • Does this answer your question? [Where can I find the sha256 code of a docker image?](https://stackoverflow.com/questions/32046334/where-can-i-find-the-sha256-code-of-a-docker-image) – tripleee May 03 '22 at 07:41
  • @tripleee please read my question, thanks. I know how to find `sha256` of an image I pulled in server. – Saeed May 03 '22 at 09:08
  • I have read your question multiple times and it's still unclear. Please [edit] to clarify which precise problem you are trying to solve. – tripleee May 03 '22 at 09:10

0 Answers0