HAProxy is free, open source software that provides a high availability load balancer and proxy server for TCP and HTTP-based applications that spreads requests across multiple servers. It is written in C and has a reputation for being fast and efficient (in terms of processor and memory usage).
- Based on the super slim tklx/base (Debian GNU/Linux).
- HAProxy installed directly from Debian.
- Uses tini for zombie reaping and signal forwarding.
Due to the versatility of HAProxy deployments, we recommend using the official upstream starter guide or configuration and management guides and the provided [examples][haproxy-examples]. This image comes with no custom configuration nor a default set of exposed ports.
While many examples show daemon
in the global
section of the config file, this will cause the Docker container to fail on launch and should not be enabled.
$ docker run -d --name some-haproxy -v /path/to/haproxy.cfg:/etc/haproxy/haproxy.cfg:ro tklx/haproxy
$ docker run -it --rm --name some-haproxy -v /path/to/haproxy.cfg:/etc/haproxy/haproxy.cfg:ro tklx/haproxy -c -f /etc/haproxy/haproxy.cfg
$ docker run -d -p 8080:80 -p 4343:443 tklx/haproxy
$ docker run --name some-haproxy -dP tklx/haproxy
$ docker port some-haproxy
If you have edited your haproxy.cfg file, you can use haproxy's graceful reload feature by sending a SIGHUP to the container:
$ docker kill -s HUP some-haproxy
The entrypoint script in the image replaces the haproxy
command with haproxy-systemd-wrapper
from HAProxy upstream, which takes care of signal handling to do the graceful reload. Under the hood this uses the -sf option of haproxy so "there are two small windows of a few milliseconds each where it is possible that a few connection failures will be noticed during high loads" (see Stopping and restarting HAProxy).
The Docker image is built, tested and pushed by CircleCI from source hosted on GitHub.
- Tag:
x.y.z
refers to a release (recommended). - Tag:
latest
refers to the master branch.
Currently on major version zero (0.y.z). Per Semantic Versioning, major version zero is for initial development, and should not be considered stable. Anything may change at any time.
TKLX uses a central issue tracker on GitHub for reporting and tracking of bugs, issues and feature requests.