├── LICENSE ├── README.md ├── bamboo-agent ├── Dockerfile ├── README.md ├── bin │ ├── bamboo-capability │ └── bamboo-capability-command ├── install │ ├── all.sh │ ├── base.sh │ ├── java.sh │ ├── phantomjs.sh │ ├── postgresql.sh │ ├── rbenv.sh │ └── rubies.sh ├── start │ ├── bamboo-agent │ └── postgresql └── supervisor │ ├── bamboo-agent.conf │ └── postgresql.conf ├── bamboo-server ├── Dockerfile ├── README.md ├── bamboo-server.sh └── supervisor.conf ├── base ├── Dockerfile ├── README.md ├── init │ └── timezone ├── start │ └── supervisord └── supervisord.conf ├── scripts ├── build.sh ├── cleanup.sh └── push.sh └── supervisord ├── Dockerfile ├── start └── supervisord └── supervisord.conf /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Hannes Wüthrich 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Images for [Docker](http://docker.io) 2 | 3 | My collection of **:whale: Docker** images. Also see my profile on [index.docker.io](https://index.docker.io/u/hwuethrich/). 4 | 5 | ## Generic 6 | 7 | > Some general purpose images I use as a starting point in my other images. 8 | 9 | #### [`hwuethrich/base`](/base) 10 | 11 | Base image with [eatmydata](https://www.flamingspork.com/projects/libeatmydata/) and no apt cache for fast and lean builds. 12 | 13 | #### [`hwuethrich/supervisord`](/supervisord) 14 | 15 | Base image with [supervisord](http://supervisord.org) for managing multiple processes in a single Docker container. 16 | 17 | ## Atlassian [Bamboo](https://www.atlassian.com/software/bamboo) 18 | 19 | > Deploy your own CI infrastructure of any size anywhere with Bamboo + Docker in just 10 minutes. 20 | 21 | #### [`hwuethrich/bamboo-server`](/bamboo-server) 22 | 23 | Deploy and maintain your Bamboo server with Docker. Works with 5.1 and later. 24 | 25 | #### [`hwuethrich/bamboo-agent`](/bamboo-agent) 26 | 27 | Easily scale your Bamboo infrastructure with remote agents running in Docker. Built-in support for many languages, database stores and libraries. 28 | 29 | ## Contributions 30 | 31 | I :heart: contributions! :) Just fork and send me a pull request. 32 | -------------------------------------------------------------------------------- /bamboo-agent/Dockerfile: -------------------------------------------------------------------------------- 1 | # Bamboo Agent 2 | # 3 | # VERSION 0.0.1 4 | 5 | FROM hwuethrich/supervisord 6 | MAINTAINER H. Wüthrich "hw@5px.ch" 7 | 8 | # Environment 9 | ENV BAMBOO_USER bamboo 10 | ENV BAMBOO_HOME /home/$BAMBOO_USER 11 | 12 | # Install Bamboo Agent 13 | ADD start /start 14 | ADD supervisor /etc/supervisor/conf.d 15 | ADD bin /usr/local/bin 16 | 17 | # Add and run install scripts 18 | ADD install /tmp/install 19 | RUN /tmp/install/all.sh && rm -rf /tmp/install 20 | 21 | # Run supervisord 22 | CMD ["/start/supervisord"] 23 | -------------------------------------------------------------------------------- /bamboo-agent/README.md: -------------------------------------------------------------------------------- 1 | # Bamboo Agent 2 | 3 | Docker image to run [Atlassian Bamboo](https://www.atlassian.com/software/bamboo) agent with common DB engines and libraries. 4 | 5 | ## Motivation 6 | 7 | If you are using Bamboo as your CI platform, you probably use [remote agents](https://quickstart.atlassian.com/download/bamboo/get-started/agents/) to run your tests/builds in parallel on separate VMs or even physical servers. You are probably using something like Chef or Puppet to automate the setup of these agents and install requirements like database servers, libraries etc. to run your builds in a consistent environment. 8 | 9 | At work, we were using Chef to provision 6 agents running in a virtual Xen environment and install PostgreSQL and other dependencies to run the test suites of our various Ruby on Rails projects. Every now and then, agents started to behave strangely and we had to spin-up new ones to replace them. This took us only about 30 minutes and we were quite happy with this setup, although we had to maintain the Chef cookbooks for the setup, which sometimes broke because of changes in newer versions of Chef or the cookbooks we used. 10 | 11 | We were also evaluating services like [Travis CI](https://travis-ci.com/) or [Semaphore](https://semaphoreapp.com/) (which are awesome!), but we have one project which is using a Microsoft SQL database, which is not (easily) available on any of these services. We also wanted to parallelize our tests for quicker feedback, which can become quite expensive if you need 8+ workers. 12 | 13 | When I discovered [Docker](http://docker.io), I instantly realized how this could reduce the time required to setup and and maintain our CI setup and I started creating images for Bamboo server and remote agents. Thanks to Docker, it took us only 10 minutes to setup a fully functional CI environment with Bamboo server and 10+ agents on a single physical Linux server at [Hetzner](http://www.hetzner.de/) (for just €49/month). Each agent requires only about 500MB of memory and build times went down to about 5 minutes (compared to 20-30 minutes when running as a VM in Xen). 14 | 15 | 16 | ## Usage 17 | 18 | When you start the container for the first time, it downloads the Bamboo agent installer from the Bamboo server. Therefore it should work with any version of Bamboo server. The agent and all other services are then started using [supervisord](http://supervisord.org/). 19 | 20 | ``` 21 | docker pull hwuethrich/bamboo-agent 22 | docker run -e BAMBOO_SERVER=http://:8085 -d hwuethrich/bamboo-agent 23 | ``` 24 | 25 | If you don't have an instance of Bamboo server running already, you might want to have a look at my [`bamboo-server`](../bamboo-server) Docker image. 26 | 27 | ### Variables 28 | 29 | * `BAMBOO_SERVER` - URL of the Bamboo Server admin interface (required) 30 | 31 | ## Stack 32 | 33 | Ultimately, the goal is to provide a technology stack similar to [Travis CI](http://about.travis-ci.org/docs/user/ci-environment/) or [Semaphore](http://docs.semaphoreapp.com/supported-stack), but we currently use this image for testing *Ruby on Rails* applications only. 34 | 35 | **If there is something missing, PLEASE feel free to open an issue or pull request! Contributions are more than welcome! :)** 36 | 37 | ### Ruby 38 | 39 | * [rbenv](https://github.com/sstephenson/rbenv) - with plugins [ruby-build](https://github.com/sstephenson/ruby-build), [rbenv-gem-rehash](https://github.com/sstephenson/rbenv-gem-rehash) 40 | * [MRI Ruby](https://www.ruby-lang.org/) 1.9.3-p448, 2.0.0-p247, 2.1.0-preview1 (default: 2.0.0) 41 | * [bundler](http://bundler.io/) 1.5.0.rc1 42 | 43 | ### Java 44 | 45 | * [Oracle JDK 7u45](http://www.oracle.com/technetwork/java/javase/downloads/index.html) 46 | 47 | 48 | ### Database engines 49 | 50 | * [SQLite](http://www.sqlite.org) 3.8.1 51 | * [PostgreSQL](http://www.postgresql.org) 9.3 from [apt.postgresql.org](http://apt.postgresql.org)
52 | *User and password is `bamboo`, but you shouldn't have to use them, because [`~/.pgpass`](http://www.postgresql.org/docs/current/static/libpq-pgpass.html) already contains these credentials.* 53 | 54 | ### Misc 55 | 56 | * [Node.js](http://nodejs.org/) 0.6.12 57 | * [PhantomJS](http://phantomjs.org/) 1.9.2 58 | * [FreeTDS](http://www.freetds.org/) 0.91 59 | * [GraphicsMagick](http://www.graphicsmagick.org/) 1.3.12 60 | * [ImageMagick](http://www.imagemagick.org/) 6.6.9-7 61 | * Xvfb 62 | 63 | 64 | -------------------------------------------------------------------------------- /bamboo-agent/bin/bamboo-capability: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -z "$1" ]; then 4 | echo "Usage: bamboo-capability []" 5 | exit 1 6 | fi 7 | 8 | BAMBOO_HOME=${BAMBOO_HOME:-$PWD} 9 | BAMBOO_CAPABILITIES=${BAMBOO_CAPABILITIES:-$BAMBOO_HOME/bin/bamboo-capabilities.properties} 10 | 11 | # Create capabilities file 12 | mkdir -p $(dirname $BAMBOO_CAPABILITIES) 13 | touch $BAMBOO_CAPABILITIES 14 | 15 | # Escape key & val 16 | key=${1// /\\ } 17 | val=${2//,/\\,} 18 | 19 | # Remove key from capability file 20 | grep -v "$key=" $BAMBOO_CAPABILITIES > $BAMBOO_CAPABILITIES.tmp 21 | mv $BAMBOO_CAPABILITIES.tmp $BAMBOO_CAPABILITIES 22 | 23 | if [ -z "$val" ]; then 24 | echo "Removed capability from $BAMBOO_CAPABILITIES: $key" 25 | else 26 | echo "$key=$val" >> $BAMBOO_CAPABILITIES 27 | echo "Added capability to $BAMBOO_CAPABILITIES: $key=$val" 28 | fi 29 | 30 | exit 0 31 | -------------------------------------------------------------------------------- /bamboo-agent/bin/bamboo-capability-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e # Exit on errors 4 | 5 | if [ -z "$1" ]; then 6 | echo "Usage: bamboo-capability-command [=