When specifying an Automated Build on Docker Hub, I can set some settings (Type
(\'Branch\' or \'Tag\'), Name
, Dockerfile Location
and
Automated docker image tagging is available on dockerhub! I fiddled with this recently and wanted to share my findings, jumping on this thread (hope it's ok!)
So I have a public GitHub repo with an automated build link on dockerhub. I want the :latest
tag to be updated every time I push to the master
branch. Also, I want :X
, :X.Y
and :X.Y.Z
tags to be created for every release I create on GitHub (tagged as vX.Y.Z
on GitHub).
Here is how the build settings config looks like to support this:
And in text so it's easier to copy-paste:
| Type | Name | Dockerfile Location | Docker Tag Name |
|--------|-----------------------------------|---------------------|-----------------|
| Branch | master | / | latest |
| Tag | /^v([0-9]+)\.([0-9]+)\.([0-9]+)$/ | / | {\1} |
| Tag | /^v([0-9]+)\.([0-9]+)\.([0-9]+)$/ | / | {\1}.{\2} |
| Tag | /^v([0-9]+)\.([0-9]+)\.([0-9]+)$/ | / | {\1}.{\2}.{\3} |
Hope this helps!