Use tags to indicate specific versions of an image, if needed. In our how to call a Service image from Docker Hub example, we called:
services:
apache:
image: tugboatqa/httpd:2.4
mysql:
image: tugboatqa/mysql:5.6
In this example, we called versions 2.4
and 5.6
for the httpd
and mysql
images. These are Docker image version
tags.
You can specify version tags in a few different ways:
If you don’t need a specific version of a Service image, you can leave the tag off of the image
call. When you don’t specify a tag, you’ll get the latest version of that image. However, because latest
pulls the
newest version of an image, it could introduce a breaking change, so we recommend specifying major/minor versions as
needed.
If you’re not sure which version tag to use, you can always browse to the service image on Docker Hub and check out what tags are available.
Using specific version tags helps prevent breaking changes that come along with incremental updates. In our example
above, we’ve called tugboatqa/mysql:5.6
instead of tugboatqa/mysql:5
.
If you want to make sure you’re using a specific major version, but don’t care about point releases, specify something
like tugboatqa/node:10
to ensure you always use the latest available minor release of node 10.x.
In some cases, you’re less likely to be worried about a specific version; for example, it may not matter which version of memcached you use.
When you don’t need to call for a specific version of a Service, using the image name without a tag
(tugboatqa/memcached
), or the latest
tag (tugboatqa/memcached:latest
) will get you the most recent version of a
Service image.