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

Configuring Docker agent in YAML Bamboo specs

thenathanjones June 19, 2018

Hi,

I'm migrating a build from using Jenkins with a Jenkinsfile to Bamboo. I'm looking to use the YAML version of configuring as opposed to Java. I would like to run my tasks in Docker agents as I was doing previously, but I can't work out, if it's even possible, how to pass arguments.

This is what I have currently in Jenkins which I'm looking to replicate:

 agent { docker { image 'node:9.11-alpine' args '-v $HOME/.m2:/root/.m2 -e HTTPS_PROXY -e HTTP_PROXY -e NO_PROXY' } }

I can specify the image in my bamboo.yaml very simply using the following on my job:

dockerImage: node:9.11-alpine

This doesn't get me all the way, as I'm not able to pass through the shared volume for the Maven cache, and more importantly the proxy variables from the host.

Is what I'm doing even possible? If not, is there a workaround? If not, is this on the roadmap for features to be added?

Cheers,

Nathan

2 answers

1 vote
Robert W
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 20, 2018

Nathan,

 

At this time it is not possible to pass anything other than just the dockerImage for use in Docker Runner using YAML specs.

 

If you need more control over the arguments passed to the Docker container, I suggest you try out Java Specs instead.  Java specs allows for much more complexity in the build definitions.

Docker Volumes: Bamboo Java Specs

 

Cheers, Robert Watson Dev Tools Support | Atlassian

thenathanjones June 20, 2018

Hi Robert, thanks for the reply. That's a shame as I'd much prefer to use YAML and avoid people creating crazy things in build pipelines.

Is there any plans in the roadmap to add this functionality to the YAML specs?

Robert W
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 20, 2018

Nathan,

I don't know if this functionality is currently on the roadmap or not.

I have, however, created a feature request for this capability here:

BAM-19952: Pass arguments to Docker Runner with YAML specs

Please be sure to watch it, and vote on it, so that you're notified if this is implemented in a future release. For your reference, you can find our policy on how we prioritize feature and improvement requests at this page. You can also add a comment to the feature request to explain your specific use-case to the developers.

I have also added a link to this post so that the developers can reference it if necessary.

Thank you, Robert Watson Dev Tools Support | Atlassian 

0 votes
thenathanjones June 21, 2018

Hi Robert,

I've just been looking through the documentation for the Java Specs and the corresponding API documentation here.

It does cover the volume creation for the Maven cache. This is nice thanks.

Unfortunately it does not resolve my principal problem which is to pass through build arguments, in my case proxy configuration. It's set on my host agent, but without being passed through I'm unable to build things that aren't able to be proxied through our Nexus server.

Can you think of any workarounds for getting this context to the build agent? 

Cheers,

Nathan

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events