Can I get an image digest without downloading the image?

前端 未结 6 506
执念已碎
执念已碎 2021-02-01 09:00

Similar to the question \"What´s the sha256 code of a docker image?\", I would like to find the digest of a Docker image. I can see the digest when I download an image:

6条回答
  •  长情又很酷
    2021-02-01 09:22

    You can get this using docker inspect:

    docker inspect --format='{{index .RepoDigests 0}}' ${IMAGE_NAME}

    Docs: https://docs.docker.com/engine/reference/commandline/inspect/

    This has been in place since at least v1.9.

提交回复
热议问题