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
You can use skopeo for this,
Example: https://github.com/containers/skopeo/tree/main#show-properties-of-fedoralatest
With docker itself:
External tools that implement this include Google’s crane, RedHat’s skopeo, and my own regclient.