hectcastro/docker-riak — pull request #9 by hectcastro (2014-04-08 18:41:58+00:00)
Title: Add automatic clustering and use phusion/baseimage-docker as the base image

[phusion/baseimage-docker](https://github.com/phusion/baseimage-docker) is a Docker image tuned for usage within Docker containers. It is based on Ubuntu, but includes several attractive features:

- Adds ability to run multiple services with [runit](http://smarden.org/runit/)
- Adds hooks for easily running scripts during startup
- Centralizes environmental variable management
- Includes useful services like `logrotate`, `cron`, `ssh`, and `syslog-ng`

This pull request switches the base Docker image from `ubuntu` to `phusion/baseimage`. In addition, it adds several environmental variables for managing the way a Riak cluster is formed:

- `DOCKER_RIAK_CLUSTER_SIZE` – The number of nodes in your Riak cluster
(default: `5`)
- `DOCKER_RIAK_AUTOMATIC_CLUSTERING` – A flag to automatically cluster Riak
(default: `false`)
- `DOCKER_RIAK_DEBUG` – A flag to `set -x` on the cluster management scripts
(default: `false`)

The following commands start and automatically join a `5` node Riak cluster with Docker containers:

```bash
$ DOCKER_RIAK_AUTOMATIC_CLUSTERING=1 DOCKER_RIAK_CLUSTER_SIZE=5 make start-cluster
./bin/start-cluster.sh

Bringing up cluster nodes:

Successfully brought up [riak01]
Successfully brought up [riak02]
Successfully brought up [riak03]
Successfully brought up [riak04]
Successfully brought up [riak05]

Please wait approximately 30 seconds for the cluster to stabilize.
```