Like the question β What is the docker image sha256 code ? , I would like to find a Docker image digest. I can see the digest when loading the image:
$ docker pull waisbrot/wait:latest latest: Pulling from waisbrot/wait Digest: sha256:6f2185daa4ab1711181c30d03f565508e8e978ebd0f263030e7de98deee5f330 Status: Image is up to date for waisbrot/wait:latest $
Another question, What is the endpoint of the Docker API registries for getting a digest for an image , is the answer offering the Docker-Content-Digest header.
I see that there is a Docker-Content-Digest header when I retrieve the manifest for the image:
$ curl 'https://auth.docker.io/token?service=registry.docker.io&scope=repository:waisbrot/wait:pull' -H "Authorization: Basic ${username_password_base64}"
However, this title is not the same. The pull command got me 6f21 , and the title 128c shows 128c . In addition, the pull command does not work for this digest:
$ docker pull waisbrot/ wait@sha256 :128c6e3534b842a2eec139999b8ce8aa9a2af9907e2b9269550809d18cd832a3 Error response from daemon: manifest unknown: manifest unknown
while everything works the way I want when I have the correct digest:
$ docker pull waisbrot/ wait@sha256 :6f2185daa4ab1711181c30d03f565508e8e978ebd0f263030e7de98deee5f330 12:46 waisbrot@influenza sha256:6f2185daa4ab1711181c30d03f565508e8e978ebd0f263030e7de98deee5f330: Pulling from waisbrot/wait Digest: sha256:6f2185daa4ab1711181c30d03f565508e8e978ebd0f263030e7de98deee5f330 Status: Image is up to date for waisbrot/ wait@sha256 :6f2185daa4ab1711181c30d03f565508e8e978ebd0f263030e7de98deee5f330
I'm looking for a way to convert the latest tag (which changes all the time) to a fixed digest that I can reliably pull out. But I donβt really want to pull it to make this translation.
source share