Docker Hub Automated Build – Tagging

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:
dockerhub build settings

And in text so it’s easier to copy-paste:

| Type   | Name                              | Dockerfile Location | Docker Tag Name |
|--------|-----------------------------------|---------------------|-----------------|
| Branch | master                            "https://stackoverflow.com/" latest          |
| Tag    | /^v([0-9]+)\.([0-9]+)\.([0-9]+)$/ "https://stackoverflow.com/" {\1}            |
| Tag    | /^v([0-9]+)\.([0-9]+)\.([0-9]+)$/ "https://stackoverflow.com/" {\1}.{\2}       |
| Tag    | /^v([0-9]+)\.([0-9]+)\.([0-9]+)$/ "https://stackoverflow.com/" {\1}.{\2}.{\3}  |

Hope this helps!

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)