34

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 ?

Aravind
  • 515
  • 1
  • 5
  • 9

6 Answers6

12

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]
peterevans
  • 34,297
  • 7
  • 84
  • 83
  • thanks this was what i needed, then when need it it you can always perform docker pull jaegertracing/jaeger-agent@sha256:bacc749faba325fbe39dc13294c2222fb0babc9ecd344c25d9d577720a80b5ca – David Bister Mar 16 '23 at 08:12
2

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.

Max Gasner
  • 1,191
  • 1
  • 12
  • 18
2

get the image id and then replace IMAGE_ID with it.

docker image inspect --format '{{json .}}' "$IMAGE_ID" | jq -r '. | {Id: .Id, Digest: .Digest, RepoDigests: .RepoDigests, Labels: .Config.Labels}'
jihad.khorfan
  • 335
  • 2
  • 15
0

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.

Shihe Zhang
  • 2,641
  • 5
  • 36
  • 57
0

Search version

Example 1

docker image inspect nameimage:latest --format '{{ .Config.Env }}'

Example 2

docker image inspect imageID --format '{{ .Config.Env }}'

More detail with you context

docker image inspect jaegertracing/jaeger-agent:latest --format '{{ .Config.Env }}'

Good Luck :)!

-1

I get following error on executing the jq -r

jq : The term 'jq' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:61

  • ... ocker image inspect --format '{{json .}}' "3fda1307ec65" | jq -r '. | ...
  •                                                            ~~
    
    • CategoryInfo : ObjectNotFound: (jq:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException
  • 1
    If you have an issue, please create a new question on stack overflow rather than bumping other people's questions – ScottC Oct 18 '22 at 22:57