Manage and run your Bamboo Remote Build Agents using Docker. This image is suitable for Java development and comprises:
- Bamboo Agent
- OpenJDK 7
- GIT, Mercurial, CVS and SVN
- Maven 2, 3 and Ant
Remote Build Agents
A Bamboo server can be run using one or more remote build agents (up to 100 depending on your license). Build agents execute jobs within your build plan and since jobs can have different requirements, it is useful to manage and run those build agents using Docker.
- Ease of use (script the creation/maintenance of your build agents)
- Duplicate and distribute changes to build agents very quickly
- Running multiple remote agents on the same host without conflicting requirements
Note this image does not include a Bamboo server. Download and install Bamboo server separately before continuing (https://www.atlassian.com/software/bamboo)
Ensure your Bamboo server is running.
Once the server is running go to the Administration > Agents console. Note that there are currently no remote build agents. When the remote build agent is run (instructions follow) it will connect to the server and you will see it appear here (once you refresh).
The following commands may need to be preceded with "sudo " depending on folder permissions and also because docker needs to be run as root. You may also need to replace "docker" with "docker.io" (depending on your installation).
Pull the remote build agent from the Docker Hub Repository
docker pull atlassian/bamboo-java-agent
Once downloaded, run your agent with the following command.
docker run -e HOME=/root/ -e BAMBOO_SERVER=http://hostname:port/bamboo -i -t atlassian/bamboo-java-agent:5.6.1
- specify your server's name and port instead of host:port (port is typically 8085)
- avoid using localhost (since this will refer to the localhost inside the container).
Go back to the Administration > Agents console. Note now that your remote agent has registered itself.
Our predefined images are based on our own atlassian/ubuntu-minimal image that is build using docker contrib script and debootstrap.
To customise take a predefined image and run it in container. Name the container for easier access later.
docker run --name="tmp-name" -e HOME=/root/ -i -t atlassian/bamboo-java-agent:5.6.1 /bin/bash
Now change whatever you want inside container with usual bash commands. You can enforce some capabilities by changing the file in /root/bamboo-agent-home/bin/bamboo-capabilities.properties.
After that exit and create new image from container like this.
docker commit tmp-name atlassian/customized-agent:1.0.0
You can also publish it pushing it to registry.
If you have DNS problems (i.e. the docker container can ping the IP of the server but not the hostname) consider using "--dns=your-dns-server-ip1 --dns=your-dns-server-ip2" as command line parameters after "docker run". Note: you need to use the actual ip addresses of your dns server and not 'your-dns-server-ip1'.
If the agent seems to connect and start bootstrapping but has trouble with active mq then check on your bamboo server that you have set up the broker url correctly. Admin > General settings. You can't have localhost specified.