skip to Main Content

I can get a hash of local docker image with

docker inspect --format='{{index .RepoDigests 0}}' myimage:latest

Can I get the same for a remote image? Something like

docker pull --hash-only cr.yandex/12345/myimage:latest

Or another thing that could solve my problem (pulling image on very low disk space machines): how to make docker pull auto delete old unused layers before pulling updated layers.

2

Answers


  1. With docker itself:

    $ docker buildx imagetools inspect busybox --format '{{json .Manifest.Digest}}'
    "sha256:2376a0c12759aa1214ba83e771ff252c7b1663216b192fbe5e0fb364e952f85c"
    

    External tools that implement this include Google’s crane, RedHat’s skopeo, and my own regclient.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search