Bamboo Docker Tag Best Practice


I want to use Bamboo to start doing the building of  Docker images. But I would like a better tag than just giving everything the "latest". And I don't want to have to go back in and tag each. The Dockerfile will have a version of the application it is building in many cases.

What is the best methods found for a good version naming scheme when doing builds in Bamboo? Most of the images I currently am building, are based on applications that have their own versions, so I have been using those as the tag for the version, then an added increment number if I have rebuilt, but not updated the applications version. This increment I plan to use the Bamboo build number instead.

What is everyone else commonly doing?


1 answer

Having same problem.  Want the version to be in the Dockerfile but also part of the tag.

Not sure how to have Bamboo retrieve the version from the Dockerfile and use it as part of a variable.

I was able to run a script to export it to a file then use the InjectVariablesTask to retrieve back out.  However, my understanding is that the variable is then only available on the agent or in deployment plans.  It is NOT available in a follow-up task in the same plan.

I.e. I need in the step right after where I use the DockerBuildImageTask which is where I want to specify the tag to use.

I want to use the format:


If you set the scope for the InjectVariablesTask to not local, it will make it available in other jobs in later Stages in the same Plan.

I'll split my stage in two to see if that helps.  Thanks!

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,663 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you