Sign inSign up

hectcastro/riak-cs-haproxy

By hectcastro

•Updated almost 11 years ago

HAProxy image that automatically load balances requests against linked Riak CS containers.

Image
5

3.1K

hectcastro/riak-cs-haproxy repository overview

⁠docker-riak-cs-haproxy Build Status

This is a Docker⁠ project to bring up an HAProxy instance that automatically populates linked Riak CS⁠ containers into an HAProxy backend.

⁠Prerequisites

⁠Install Docker

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

⁠Build image

⁠Clone repository and build
$ git clone https://github.com/hectcastro/docker-riak-cs-haproxy.git
$ cd docker-riak-cs-haproxy
$ make build

⁠SSH

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.

Tag summary

Content type

Image

Digest

sha256:aa3b1784c…

Size

147.1 MB

Last updated

almost 11 years ago

docker pull hectcastro/riak-cs-haproxy