Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding the actual version of latest version of docker image

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 ?

like image 347
Aravind Avatar asked Oct 02 '19 21:10

Aravind


Video Answer


2 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]
like image 115
peterevans Avatar answered Oct 31 '22 09:10

peterevans


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.

like image 34
Max Gasner Avatar answered Oct 31 '22 10:10

Max Gasner