Versioning Images and Docker Hub

Remember talking about versioning images in Topic D? We did that by adding latest and using some numbers against our images, such as 3.x.x or 3.x.x-rc.

In this topic, we'll go through using tags for versioning and look at how official images have been versioned in the past, thereby learning best practices.

The command in use here is the following:

docker build -t <image-name>:<tag> <relative location of the Dockerfile>

Say, for example, we know that Python has several versions: Python 3.6, 3.5, and so on. Node.js has several more. If you take a look at the official Node.js page on Docker Hub, you see the following at the top of the list:

9.1.0, 9.1, 9, latest (9.1/Dockerfile) (as of November 2017):

This versioning ...

Get Beginning DevOps with Docker now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.