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