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.
Cannot pull this image.
Getting the following error message.
failed to register layer: re-exec error: exit status 1: output: ProcessBaseLayer C:\ProgramData\docker\windowsfilter\8ea18d71e74f704460b76aed4012373b67bb070bbacbe28c284ddae5245a86f7: The system cannot find the path specified.
INFO | jvm 4 | 2016/01/09 16:25:10 | 2016-01-09 16:25:10,676 WARN [Thread-0] [MavenUtils] Failed to get Maven version, unable to analyze output:
INFO | jvm 4 | 2016/01/09 16:25:10 | Apache Maven 3.0.5
INFO | jvm 4 | 2016/01/09 16:25:10 | Maven home: /usr/share/maven
INFO | jvm 4 | 2016/01/09 16:25:10 | Java version: 1.7.0_65, vendor: Oracle Corporation
INFO | jvm 4 | 2016/01/09 16:25:10 | Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
INFO | jvm 4 | 2016/01/09 16:25:10 | Default locale: en_US, platform encoding: ANSI_X3.4-1968
INFO | jvm 4 | 2016/01/09 16:25:10 | OS name: "linux", version: "4.1.13-boot2docker", arch: "amd64", family: "unix"
INFO | jvm 4 | 2016/01/09 16:25:10 | 2016-01-09 16:25:10,677 WARN [Thread-0] [MavenUtils] Unable to get Maven version from /usr/share/maven/bin/mvn
INFO | jvm 4 | 2016/01/09 16:25:12 | 2016-01-09 16:25:12,119 WARN [Thread-0] [MavenUtils] Failed to get Maven version, unable to analyze output:
The Ant installation is at a bare minimum and unfortunately includes JUnit 3 in the runtime libraries - and is missing ant-junit.jar from that same runtime libraries. It isn't the the full Ant distribution that you find in the official binary release. But, here I am still having to use Ant - so maybe I'm the guy at fault.
Any plan to release the source code of the build ?
Also can you update the agents with the last version ?