Product Docs
Open Source
Education
A minimal haproxy base image rebuilt every night from source.
The image is available on cgr.dev:
cgr.dev
docker pull cgr.dev/chainguard/haproxy:latest
Similar to the docker-library/haproxy image, this image does not come with any default configuration.
docker-library/haproxy
Please refer to upstream’s excellent (and comprehensive) documentation on the subject of configuring HAProxy for your needs.
Let say you have a haproxy.cfg config file is current working directory. To test that configuration file, you can run the following command
haproxy.cfg
docker run -it --rm -v "$(pwd):/etc/haproxy" --name haproxy-syntax-check cgr.dev/chainguard/haproxy haproxy -c -f /etc/haproxy/haproxy.cfg
In order for the container to work, you need to mount your custom haproxy.cfg file in the container. The following example runs HAProxy with a custom configuration file:
docker run -it --rm -v "$(pwd):/etc/haproxy" cgr.dev/chainguard/haproxy haproxy -f /etc/haproxy/haproxy.cfg