This is a Docker project to bring up an HAProxy instance that automatically populates linked Riak CS containers into an HAProxy backend.
Follow the instructions on Docker's website to install Docker 0.10.0+.
From there, ensure that your DOCKER_HOST
environmental variable is set
correctly:
$ export DOCKER_HOST="tcp://192.168.59.103:2375"
Note: If you're using boot2docker
ensure that you forward the virtual machine ports 8080
and 8888
. This
will allow you to interact with the container as if it were running locally:
$ for i in {8080,8888}; do
VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port$i,tcp,,$i,,$i";
VBoxManage modifyvm "boot2docker-vm" --natpf1 "udp-port$i,udp,,$i,,$i";
done
$ git clone https://github.com/hectcastro/docker-riak-cs-haproxy.git
$ cd docker-riak-cs-haproxy
$ make build
The phusion/baseimage-docker
image has the ability to enable an insecure key for conveniently logging
into a container via SSH. It is enabled in the Dockerfile
by default here:
RUN /usr/sbin/enable_insecure_key
In order to login to the container via SSH using the insecure key, follow the steps below.
Use docker inspect
to determine the container IP address:
$ docker inspect $CONTAINER_ID | egrep IPAddress
"IPAddress": "172.17.0.2",
Download the insecure key, alter its permissions, and use it to SSH into the container via its IP address:
$ curl -o insecure_key -fSL https://github.com/phusion/baseimage-docker/raw/master/image/insecure_key
$ chmod 600 insecure_key
$ ssh -i insecure_key [email protected]
Note: If you're using
boot2docker, ensure that you're
issuing the SSH command from within the virtual machine running boot2docker
.