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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to perform containerised builds when using bamboo-agent Docker image

If I'm running Bamboo server and the agent in Docker containers how should I set up containerised builds?

Should the agent be able to start containers on the host or do Docker in Docker? Any other ideas? Has anyone done this? I'd like to trash the container that actually does the build, so I'd like to avoid adding the build tools to the agent image.

1 answer

From your description I would say that mounting the host Docker socket as volume in the agent container would be the best option, for reasons described here.

Your agent image would then only need to install the Docker client binary, which can be done by extending the Bamboo agent base image as described in the readme. Your agent would manage your build container as siblings.

In such a setup, you should be able to use the Bamboo Docker Runner.

If you happen to run on Kubernetes (which I cannot derive from your description), Docker-in-Docker is most often the best option (security aspects kept in mind), as described here. This configuration is implemented in the plugin Kubernetes Agents for Bamboo (note that I am affiliated with this plugin).

Happy to discuss further if you have any more questions.

Thanks for your reply. This sounds like exactly what I need to do. I'd wondered about mounting the host's Docker socket, but wasn't sure if that was a sensible solution.

 

I'm not on Kubernetes so using Docker on the host sounds ideal.

Keep in mind that going the socket route, you might run into permission issues as the Bamboo agent base image is running as user 'bamboo' (UID 1000), which will in a usual setup have no permissions over this socket. You will need to add this user to the docker group on the host system, change the socket permissions or otherwise extend the base image to run as root. 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 7.2 is here!

I'm happy to announce that Bamboo 7.2 has been released and it’s overflowing with awesome new features. This will be the last major Server release before the launch of Bamboo DC. Bamboo logs We...

450 views 5 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you