A Dockerfile that produces a Vagrant-ready, CentOS 7-based Docker image that will run the latest stable HAProxy.
The build is based on [internavenue/docker-centos-base][docker-centos-base].
This example creates the image with the tag internavenue/centos-haproxy, but you can
change this to use your own username.
$ docker build -t="internavenue/centos-haproxy" .
Alternately, you can run the following if you have GNU Make installed...
$ make
You can also specify a custom docker username like so:
$ make DOCKER_USER=internavenue
The HAProxy load balancer can be configured to use external volumes, such as
This example uses /srv/docker/lon-dev-haproxy to host the web application, but you can modify
this to your needs.
$ mkdir -p /srv/docker/lon-dev-haproxy
$ docker run -d -name="lon-dev-haproxy" \
-p 127.0.0.1:80:80 \
-v /srv/docker/lon-dev-haproxy/log:/var/log \
-v /srv/docker/lon-dev-haproxy/run:/run \
-v /srv/docker/lon-dev-haproxy/lib:/var/lib/haproxy \
internavenue/centos-haproxy
Alternately, you can run the following if you have GNU Make installed...
$ make run
You can also specify a custom port to bind to on the host, a custom web root directory, and the superuser username and password on the host like so:
$ sudo mkdir -p /srv/docker/lon-dev-haproxy
$ make run PORT=127.0.0.1:8080 \
DATA_DIR=/my/spec/data/dir \
Content type
Image
Digest
sha256:068f4a796…
Size
195.2 MB
Last updated
over 10 years ago
docker pull internavenue/centos-haproxy