Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know which version of docker image is behind latest tag?

Tags:

I am working with two docker images of tensorflow (latest and latest-gpu tags):

FROM tensorflow/tensorflow:latest-gpu

and:

FROM tensorflow/tensorflow:latest

In order to not have surprises in the future, I would like to set the version of these two images.

On docker hub, I can't find this information in the tags pages: for example, latest would correspond to the 1.8.0-gpu tag.

Do you know if and where I can find this information?

Thank you,

Alexandre

like image 574
AlexandreS Avatar asked Jun 05 '18 14:06

AlexandreS


People also ask

How do I find the version of a docker image?

To see the images on your system, run the docker images or docker image ls command. If you check the output of either of the commands, you'll see that they list the available images, alongside their version tags, IDs, and other stuff. It's the version tag that we want here.

How do I view image tags in docker?

There's a way to check all version tags on Docker Hub (for example), against the local docker image's “Image ID”. You can get every tag from a Docker Registry (like Docker Hub), then use every tag you found, to get the image ID information from the manifest of every image.

What is latest docker tag?

The latest tag is applied by default to reference an image when you run Docker commands without specifying the tag value. The latest tag is applied to the most recent docker build or docker tag command that was run without a tag value explicitly set.


2 Answers

is kinda BULLPOOP actually that docker do NOT do what is minimum of good sense and report such thing, and unfortunately the only solution I seem to find is ... oh well, ACTUALLY FISHING:

go to image webpage (nigix in my case) https://hub.docker.com/_/nginx then press tags tab, go to any latest, and copy sha256 sum then sort by newest, then scroll down until first numbered version and check if the exact same sha256 is displayed

now ... STILL after that fishing, there library/nginxit comes a sure thing:

you can verify if you did it right, for example now I manage to find that nginx:latest is actually 1.17.8, so, I run:

docker pull nginx:1.17.8
1.17.8: Pulling from library/nginx
bc51dd8edc1b: Pull complete
66ba67045f57: Pull complete
bf317aa10aa5: Pull complete
Digest:sha256:ad5552c786f128e389a0263104ae39f3d3c7895579d45ae716f528185b36bc6f
Status: Downloaded newer image for nginx:1.17.8

and then I verify by atempt to pull latest:

docker pull nginx:latest
latest: Pulling from library/nginx
Digest: sha256:ad5552c786f128e389a0263104ae39f3d3c7895579d45ae716f528185b36bc6f
Status: Downloaded newer image for nginx:latest

how you can see it didn't actually pull anything, and sha256 is the exact same ;)

like image 158
THESorcerer Avatar answered Oct 11 '22 01:10

THESorcerer


Do you know if and where I can find this information?

Just to make something clear. Docker images can have multiple tags around them. Closer inspection of said images reveal that they have single tag only (just latest) so they are not tagged additionally. Thus said from images themselves you can't deduct which tensorflow version they relate to.

However, you do have other option:

  • Easiest way to make sure you use correct 'versioned' tensorflow image instead of latest is to actually start latest image:

    docker run -it --rm -p 8888:8888 tensorflow/tensorflow:latest
    

    or

    nvidia-docker run -it -p 8888:8888 tensorflow/tensorflow:latest-gpu
    

    then, navigate to given url link in format:

    http://localhost:8888/?token=XXXX...
    

    and in jupyter create new notebook File->New Noteboot->Python2 and there check tensorflow version by giving:

    import tensorflow as tf
    print tf.VERSION
    

    or

    import tensorflow as tf
    tf.__version__
    

    Then run it. Note that in my case for latest tag response was: 1.8.0, however if you pulled latest image a while ago and didn't update in the meantime (or reading this in the future) version you get can be different than this.

  • Once you got the version you are using, you can simply navigate at the the tags pages you mentioned in your post to take correct tag (in my case that would be 1.8.0 and 1.8.0-gpu respectively (since I was offered Python2 from latest tag).
  • Short note on selecting proper tag from suffixes (for 1.8.0 version):
    • In most cases you will select one of the following stable release images:
      • 1.8.0-gpu-py3 - stable release image gpu python 3
      • 1.8.0-py3 - stable release image cpu python 3
      • 1.8.0-gpu - stable release image gpu python 2
      • 1.8.0 - stable release image cpu python 2 <-- this is proper tag in my case for cpu latest.
    • However, you might choose development or release candidates in some special circumstances:
      • 1.8.0-devel-gpu-py3 - development release gpu python 3
      • 1.8.0-devel-gpu - development release gpu python 2
      • 1.8.0-devel-py3 - development release cpu python 3
      • 1.8.0-devel - development release cpu python 2
      • 1.8.0-rcN-devel-gpu-py3 - development release candidate gpu python 3
      • 1.8.0-rcN-devel-py3 - development release candidate cpu python 3
      • 1.8.0-rcN-gpu-py3 - stable release candidate gpu python 3
      • 1.8.0-rcN-py3 - stable release candidate cpu python 3
      • 1.8.0-rcN-gpu - stable release candidate gpu python 2
      • 1.8.0-rcN - stable release candidate cpu python 2
like image 35
Const Avatar answered Oct 11 '22 01:10

Const