Finding the actual version of latest version of docker image

Viewed 8405

docker pull jaegertracing/jaeger-agent:latest

Jaeger is just for illustration. But my question is more generic. The above command pulls the latest version of the jaeger-agent from docker-hub.

The docker-hub page for this is : https://hub.docker.com/r/jaegertracing/jaeger-agent

My question is how do I find the actual version of latest ?

I looked in to the tags here, but there is not much info : https://hub.docker.com/r/jaegertracing/jaeger-agent/tags

Also I tried doing an inspect after pulling the image, but could not get necessary details.

docker image inspect jaegertracing/jaeger-agent:latest

Where can we get this information from ?

3 Answers

As @max-gasner mentioned, it's common for latest to be tracking the master branch of a git repository. This allows the engineers to quickly build and test images before they are released and version tagged. This is one of the reasons why it's not recommended to ever use latest tags for anything critical where you need reproducibility.

jaegertracing/jaeger-agent:latest doesn't have any other tags so the only way to determine which "version" of latest you are using is to look at the digest. This uniquely identifies the image build. Tags actually resolve to digests. So when a new image is built with the latest tag, that tag will then resolve to the digest of the new image.

enter image description here

DockerHub only shows the short version. You can inspect the full digest like this:

docker image inspect --format '{{.RepoDigests}}' jaegertracing/jaeger-agent:latest
> [jaegertracing/jaeger-agent@sha256:bacc749faba325fbe39dc13294c2222fb0babc9ecd344c25d9d577720a80b5ca]

latest is just a tag like any other -- you will want docker image inspect, which will give you information about the other tags on your image.

In the case of jaegertracing/jaeger-agent:latest, it doesn't look this image has any other tags, so it's probable that this image is tracking something like the master branch of a source control repository, i.e., it doesn't correspond to a published version at all.

There is an issue Digests on Dockerhub and those fetched by docker pull do not match not solved yet.

@peterevans's answer and this answer can help. https://stackoverflow.com/a/64309017/1543768

But if the machine can't install some tool easily, Created is an easy tool to use.

$docker images
REPOSITORY                             TAG                 IMAGE ID            CREATED             SIZE
your-image   latest              4b10e****        22 months ago         15.1MB
$IMAGE_ID=4b10e
$docker image inspect --format '{{.Created }}' $IMAGE_ID
2020-11-15T18:39:27.727222621Z

Check the date with Dockerhub.

Related