Search code examples
dockertensorflowversion

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


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


Solution

  • 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