Public | Automated Build

Last pushed: 5 months ago
Short Description
Run a dockerized Atlassian Bamboo® with dockerized PostgreSQL with persistent storage.
Full Description

docker-atlassian-bamboo

Run a dockerized Atlassian Bamboo® with dockerized PostgreSQL with
persistent storage.


 

Prerequisites


 

Initial Configuration

(1) Add hostname alias

Add the alias on your Docker-Host machine.

sudo su
echo "127.0.0.1  bamboo" >> /etc/hosts

 

Usage

It will use a dedicated network, and two volumes for Bamboo-Home and the PostgreSQL Database.

(1) Create Network and Volumes

docker network create bamboo

docker volume create bamboo-postgres-db
docker volume create bamboo-home

 

(2) Create PostgreSQL Database Instance

docker create \
    --name bamboo-db \
    --net=bamboo \
    --net-alias=bamboo-db \
    -e POSTGRES_PASSWORD=bamboo \
    -e POSTGRES_DB=bamboo \
    -e POSTGRES_USER=bamboo \
    -p 15432:5432 \
    -v bamboo-postgres-db:/var/lib/postgresql/data \
    postgres:9.6.2-alpine

docker start bamboo-db

 

(3) Create Bamboo Instance

docker create \
    --name bamboo \
    --net=bamboo \
    --net-alias=bamboo \
    -p 18085:8085 \
    -v bamboo-home:/bamboo-home \
    codeclou/docker-atlassian-bamboo:5.15.5

docker start bamboo

 

(4) Start Post Configuration

Once everythign has started uo

Go to http://bamboo:18085/. and start the Post Configuration.

<p align="center"><img src="https://codeclou.github.io/docker-atlassian-bamboo/img/bamboo-01.png" width="80%"></p>

<p align="center"><img src="https://codeclou.github.io/docker-atlassian-bamboo/img/bamboo-02.png" width="80%"></p>

<p align="center"><img src="https://codeclou.github.io/docker-atlassian-bamboo/img/bamboo-03.png" width="80%"></p>

Use the following PostgreSQL Settings:

  • jdbc: jdbc:postgresql://bamboo-db:5432/bamboo (use the internal container port 5432)
  • Username and password bamboo

<p align="center"><img src="https://codeclou.github.io/docker-atlassian-bamboo/img/bamboo-04.png" width="80%"></p>

<p align="center"><img src="https://codeclou.github.io/docker-atlassian-bamboo/img/bamboo-05.png" width="80%"></p>

<p align="center"><img src="https://codeclou.github.io/docker-atlassian-bamboo/img/bamboo-06.png" width="80%"></p>

<p align="center"><img src="https://codeclou.github.io/docker-atlassian-bamboo/img/bamboo-07.png" width="80%"></p>

<p align="center"><img src="https://codeclou.github.io/docker-atlassian-bamboo/img/bamboo-08.png" width="80%"></p>

<p align="center"><img src="https://codeclou.github.io/docker-atlassian-bamboo/img/bamboo-09.png" width="80%"></p>


 

Backup persistent Storage

You should backup the Bamboo-Home and the Database Volume frequently. How to backup docker volumes is described here.

Example procedure:

# Stop Instances
docker stop bamboo
docker stop bamboo-db

# Backup DB
docker run \
    --rm \
    -v $(pwd):/backup \
    -v bamboo-postgres-db:/var/lib/postgresql/data \
    alpine:3.5 \
    tar cvf /backup/backup-bamboo-postgres-db.tar /var/lib/postgresql/data

# Backup Bamboo Home
docker run \
    --rm \
    -v $(pwd):/backup \
    -v bamboo-home:/bamboo-home \
    alpine:3.5 \
    tar cvf /backup/backup-bamboo-home.tar /bamboo-home

Now you should have these files in your current directory:

  • backup-bamboo-home.tar
  • backup-bamboo-postgres-db.tar

 

Trademarks and Third Party Licenses


 

License

MIT © Bernhard Grünewaldt

Docker Pull Command
Owner
codeclou

Comments (0)