Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to set docker image value from a plan variable

GregD October 16, 2020

I'm trying to set the value for the Docker Image value in the Isolate Build settings of a Bamboo plan that is using the Docker Runner. To be clear, these are the settings to run a job in a container, not to perform steps to create docker images.  So the Docker Image value on the Bamboo plan configuration webpage is just a text box. When I create a plan variable like "bamboo_dockerimage" equal to a valid image location, and then enter "${bamboo.dockerimage}" in the text box (without the quotes), the variable is not substituted when the job executes. I can see the the raw unsubstituted variable name in the Docker command output when the job finishes in error log, instead of substituted value. I'm using Bamboo 6.4.0. Anyway to set the Docker image value to a variable? Ultimately I just want to override the image location from a key-value file in my source code. A new code revision might use a different image location.

 

1 answer

1 accepted

1 vote
Answer accepted
Marcin Gardias
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 6, 2020

Hmm, it seems to me that your variable's name does not match. If your plan variable (as shown in the variable UI) is named bamboo_dockerimage then the usage woudl be ${bamboo.bamboo_dockerimage}, that doesn't seem like sth. you intended.

Please rename your variable to dockerimage, then it will be referenced as ${bamboo.dockerimage} and exported as shell variable bamboo_dockerimage.

Marcin Gardias
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 6, 2020

Also, let me remind you that Bamboo version 6.4.0 is no longer supported. I strongly recommend an update to something newer.

GregD November 6, 2020

You nailed it with the variable name!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events