I’ve been thinking about writing a script that would alert me if there was an updated version of an image I was running.
DockerHub shows an image digest on the page for that tag:
And I can extract the digest for an image I am running with:
docker inspect --format='{{index .RepoDigests 0}}' jc21/nginx-proxy-manager:latest
This matches the one from the DockerHub screenshot. But I can’t see a CLI way to get the image digest from a registry. It seems like:
docker manifest inspect jc21/nginx-proxy-manager:latest
should do it, but it pulls out the digest of each of the architecture builds for that tag instead of the one shown in dockerhub.
Is there a way to compare the current local image with one in a registry from the command line? Or perhaps there’s a more sensible way to do this?
For anyone coming to this later, digests are not presented in a super-understandable way (there’s a good explanation of them in this stack-overflow). There appears to be two ways to get the digest that matches the one on the DockerHub page for the tag:
There’s a good discussion of options for finding out if images have been updated in this r/SelfHosted discussion which is what I was trying to achieve.