Return to Image List

haproxy

haproxy

HAProxy is a free, open source high availability solution, providing load balancing and proxying for TCP and HTTP-based applications by spreading 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).

See HAProxy.org for more information

This image is built by IBM to run on the IBM Z architecture and is not affiliated with any other community that provides a version of this image.


License

View license information here

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.


Versions

Use the pull string below for the version of this image you require.
2.5.5 docker pull icr.io/ibmz/haproxy@sha256:e41a42a2a52166bafd64b0d422804c6df50e8fafc63b7fcd15d57d24e3a0773a Vulnerability Report03-18-2022
2.5.7-bullseye docker pull icr.io/ibmz/haproxy@sha256:cdff0d614badf5992f46f8efeaa089f4405caa6d9d4d08a78f8a7b5dec715439 Vulnerability Report05-19-2022
2.6.5-bullseye docker pull icr.io/ibmz/haproxy@sha256:c164d12df1541b9056d1410a79b5a39d5d8dc236046dd8e5ccd69fcc086fda49 Vulnerability Report09-09-2022
2.5.1 docker pull icr.io/ibmz/haproxy@sha256:ad232e72b48eb3c5117801dc21a8a93f1804ff3f709ab34ce559b416ba0ca1b0 Vulnerability Report02-02-2022
2.6.0-bullseye docker pull icr.io/ibmz/haproxy@sha256:92e3a2bdac3972568bca563b4e5e1ed3b55a4d8062bf2d6994232417b21d20b4 Vulnerability Report06-10-2022
2.6.2-bullseye docker pull icr.io/ibmz/haproxy@sha256:8d8574f70de03d4583a8817cd064557bf9f5bd198970a48cb18e78bd2f62d160 Vulnerability Report08-19-2022
2.7.4-bullseye docker pull icr.io/ibmz/haproxy@sha256:27708188d060c884bbf22d6a40cbbcb76c488655aab7fb34d54bcc1ce6bbff42 Vulnerability Report03-13-2023
2.6.4-bullseye docker pull icr.io/ibmz/haproxy@sha256:0a9f27c9a16b6cd4fcf4faffc0045fe7abc45bbacb38111e7c90cd252406752b Vulnerability Report09-06-2022
Version Pull String Security (IBM Cloud) Created

Usage Notes

Since no two users of HAProxy are likely to configure it exactly alike, this image does not come with any default configuration.

Please refer to upstream's excellent (and comprehensive) documentation on the subject of configuring HAProxy for your needs.

It is also worth checking out the examples/ directory from upstream.

At a basic level, an HAProxy confirguration file, called haproxy.cfg, is created to define haproxy's function. Here is a basic example of what haproxy.cfg might look like:

frontend http_front
bind *:80
default_backend http_back

backend http_back
balance roundrobin
server example-server [Page IP]:[Page Port] check

This configuration will cause HAProxy to listen on port number 80, then direct traffic to the server defined in the backend. For an easy demonstration, the server could be set up as any other running Docker container on your system which serves a webpage. In that case, you would set [Page IP] to your system's IP, and [Page Port] to the port you assigned the container to listen on.

Create a file Dockerfile in the directory containing your haproxy.cfg file:

FROM icr.io/ibmz/haproxy:[version]
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg

build the container:

docker build -t my-haproxy .

Test the configuration file:

docker run -it --rm --name haproxy-syntax-check my-haproxy haproxy -c -f /usr/local/etc/haproxy/haproxy.cfg

This should return the text Configuration file is valid.

Run the container:

docker run -d -p 8098:80 --name run-haproxy --sysctl net.ipv4.ip_unprivileged_port_start=0 my-haproxy

You can now access [Your system IP]:8098 in a browser window. This should direct you to the destination specified in HAProxy.cfg!