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

Environment variable not being passed properly by Bamboo

Sanjeevi ravi May 9, 2023

we are trying to limit the docker resource on agents that we use to run bamboo jobs, we have different agents (VM and EC2 instance) running ubuntu and these agents have different memory capacity and we have a environment variable in each agents that has maximum value that can be used by docker in that respective agent example docker_maxmemory=14436m (14GB). Now we are passing an extra  argument to docker run command from bamboo like this  "--memory $docker_maxmemory" here $docker_maxmemory is variable that has some value but bamboo pass it as string instead of variable and we are getting error like this "   invalid argument "$docker_maxmemory" for "-m, --memory" flag: invalid size: '$docker_maxmemory'    " Note : bamboo runs the job in docker container  

2 answers

1 accepted

1 vote
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 9, 2023

Hello @Sanjeevi ravi,

Welcome to Atlassian Community!

As stated on the Docker configuration page:

"The input is not parsed by Bamboo"

Meaning you need to either add the value of the memory property manually or run the Docker task as a command line using a Script task in case you need a customised memory setting.

Kind regards,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Sanjeevi ravi May 9, 2023

Hi @Eduardo Alvarenga 
Thanks for the answer 
But the Script task from the bamboo will run inside the docker container we can not limit the container from inside.

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 9, 2023

Hello @Sanjeevi ravi

Yes. The Job will have to be configured as an "Agent environment" and not as a "Docker environment" for that to work from a Script task.

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Like Steffen Opel _Utoolity_ likes this
Sanjeevi ravi May 11, 2023

thanks @Eduardo Alvarenga 

0 votes
Sanjeevi ravi May 9, 2023

for reference image.png
and the error image.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events