|
| 1 | +# Bamboo Data Center |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +> Bamboo Data Center is a continuous delivery pipeline that offers resilience, reliability, and scalibility for teams of any size. |
| 6 | +
|
| 7 | +[atlassian.com/software/bamboo](https://www.atlassian.com/software/bamboo) |
| 8 | + |
| 9 | +## Setup |
| 10 | + |
| 11 | +### Build the custom image |
| 12 | + |
| 13 | +Create `.bamboo/server/Dockerfile` file: |
| 14 | + |
| 15 | +```Dockerfile |
| 16 | +# starts from the base image provided by Atlassian: https://hub.docker.com/r/atlassian/bamboo-server (7.2.2 based on Ubuntu 20.04.1 LTS, codename focal) |
| 17 | +FROM atlassian/bamboo-server:7.2.2 |
| 18 | + |
| 19 | +# switches to root user for admin commands |
| 20 | +USER root |
| 21 | + |
| 22 | +# installs system requirements |
| 23 | +RUN apt-get update |
| 24 | +RUN apt-get install -y apt-transport-https \ |
| 25 | + ca-certificates \ |
| 26 | + wget \ |
| 27 | + curl \ |
| 28 | + gnupg-agent \ |
| 29 | + software-properties-common |
| 30 | +RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - |
| 31 | +RUN add-apt-repository \ |
| 32 | + "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ |
| 33 | + $(lsb_release -cs) \ |
| 34 | + stable" |
| 35 | +RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \ |
| 36 | + && dpkg -i packages-microsoft-prod.deb |
| 37 | +RUN apt-get update |
| 38 | + |
| 39 | +# installs Docker: https://docs.docker.com/engine/install/ubuntu/ |
| 40 | +RUN apt-get install -y docker-ce \ |
| 41 | + docker-ce-cli \ |
| 42 | + containerd.io |
| 43 | +RUN usermod -a -G docker bamboo |
| 44 | + |
| 45 | +# installs .NET SDK LTS: https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu |
| 46 | +RUN apt-get install -y dotnet-sdk-3.1 |
| 47 | +RUN apt-get install -y dotnet-sdk-5.0 |
| 48 | + |
| 49 | +# switches back to bamboo user |
| 50 | +USER bamboo |
| 51 | + |
| 52 | +# updates image entrypoint with commands that can only be ran when the container starts |
| 53 | +RUN echo "chown root:docker /var/run/docker.sock" >> /entrypoint.sh |
| 54 | +``` |
| 55 | + |
| 56 | +```bash |
| 57 | +# creates a new image |
| 58 | +docker build . -t devprofr/bamboo-server -f .bamboo/server/Dockerfile --no-cache |
| 59 | +``` |
| 60 | + |
| 61 | +### Run the custom image |
| 62 | + |
| 63 | +```bash |
| 64 | +docker volume create --name bambooVolume |
| 65 | + |
| 66 | +# for Linux |
| 67 | +docker run -v /var/run/docker.sock:/var/run/docker.sock -v bambooVolume:/var/atlassian/application-data/bamboo --name="bamboo" --init -d -p 54663:54663 -p 8085:8085 devprofr/bamboo-server |
| 68 | + |
| 69 | +# for Windows |
| 70 | +docker run -v //var/run/docker.sock:/var/run/docker.sock -v bambooVolume:/var/atlassian/application-data/bamboo --name="bamboo" --init -d -p 54663:54663 -p 8085:8085 devprofr/bamboo-server |
| 71 | +``` |
| 72 | + |
| 73 | +### Configuration |
| 74 | + |
| 75 | +Open [localhost:8085](http://localhost:8085/) |
| 76 | + |
| 77 | +#### Set server capabilities |
| 78 | + |
| 79 | +_Limitation 2021-02-28_: Unfortunately it is not possible to automate it through an API call |
| 80 | + |
| 81 | +You have to manually go to this page ["Bamboo administration > Server capabilities"](http://localhost:8085/admin/agent/configureSharedLocalCapabilities.action) and set the server capabilities (if not present), it must be done only once/ |
| 82 | + |
| 83 | +Category | Executable / Label | Path | Bamboo key |
| 84 | +-----------|--------------------|-------------------|-------------------------------- |
| 85 | +Executable | dotnet | `/usr/bin/dotnet` | `system.builder.command.dotnet` |
| 86 | +Docker | Docker | `/usr/bin/docker` | `system.docker.executable` |
| 87 | + |
| 88 | +### Troubleshooting |
| 89 | + |
| 90 | +```bash |
| 91 | +docker exec -it bamboo sh |
| 92 | +docker exec -u 0 -it bamboo bash |
| 93 | +``` |
| 94 | + |
| 95 | +### Clean-up |
| 96 | + |
| 97 | +```bash |
| 98 | +docker stop bamboo |
| 99 | +docker rm bamboo |
| 100 | +``` |
0 commit comments