Docker Tags Matter

Did you know that Docker will not automatically update your local images to the :latest tag?

Now that I think about it it seems quite reasonable to me. If Docker had to check up whether your local :latest tag corresponds to the hub’s one it would make an http request for each image in your stack and that would slow down performances and, most of it, would break an online/offline behaviour predictability.

Monday:
you pull node:latest (it’s Node 6.0)

Tuesday:
they release Node7.0 on DockerHub under the :latest tag

Wednesday:
you do docker run ... node:latest

You are still running Node6!

So What?

So when you describe your application with docker-compose it may be a best-practice to explicitly set the exact tag that you want to run for each image.

Advantages:
– high degree of behaviour predictability of your application
– when you tag a release on GitHub you will be able to run exactly that release one year from now

Donwside:
– you need to explicitly update your images versions by changing the tags in your Compose file

X