A Docker image is a file that comprises instructions for a complete and executable version of a program in a Docker container.
There are four HAProxy Enterprise images available in three different registries with the following respective contents:
hapee-registry.haproxy.com/hapee-business: base HAPEE-LB components without any additional modules from HAPEE-Plus repository
hapee-plus-registry.haproxy.com/hapee-business-plus: base HAPEE-LB components and all other HAPEE modules and libraries
hapee-plus-registry.haproxy.com/hapee-stkagg: HAPEE Stick Table Aggregator image as a main process, based on
hapee-business-plus, but as a separate image to facilitate stick table aggregation
kubernetes-registry.haproxy.com/haproxy-ingress: HAPEE-LB as a Kubernetes Ingress Controller
Logging into the registry
Before you can pull the docker images, you must log into the corresponding HAProxy Enterprise docker registry using your "HAPEE key".
For the rest of this section, we use the
hapee-business-plus image. Hence, we must log into the
$ docker login https://hapee-plus-registry.haproxy.com username is customer's HAProxy Enterprise key (for plus repository) password is customer's HAProxy Enterprise key (for plus repository)
Pulling the Docker image
To pull the Docker image, run:
$ docker pull hapee-plus-registry.haproxy.com/hapee-business-plus
Running HAProxy Enterprise
To start HAProxy Enterprise, run:
docker run --name hapee -d -p 80:80 -p 443:443 -v /hostdir/hapee-lb.cfg:/etc/hapee-1.8/hapee-lb.cfg hapee-plus-registry.haproxy.com/hapee-business-plus
This assigns the
hapee name to the Docker container, publish ports 80 and 443, and mount the
hapee-lb.cfg from in the current directory to use as the HAProxy Enterprise configuration file.
If you need to update the HAProxy configuration:
Edit the file
hapee-lb.cfgon the host machine.
Restart the Docker container with this command:
docker restart hapee
Setting up logs for HAProxy
The default HAProxy configuration enables logging and sends logs to
localhost using the default
syslog udp port: 514.
To obtain these logs, you can either change the logging to
stdout or start a sidecar
This is the preferred method if you are working in a cloud or microservices environment.
Replace the default log configuration and use
stdoutlogging instead of the
log stdout local0directive.
To see the logs, run:
docker logs -f hapee
Configure a sidecar
You can also keep the default logging configuration and add a sidecar
syslog container to share the same network stack as the HAProxy Enterprise container.
In the file
cocker-compose, add the following:
version: '2' services: hapee: image: hapee-plus-registry.haproxy.com/hapee-business-plus container_name: hapee volumes: - /hostdir/hapee-lb.cfg:/etc/hapee-1.8/hapee-lb.cfg ports: - 80:80 - 443:443 rsyslog: image: jumanjiman/rsyslog container_name: rsyslog network_mode: "service:hapee"
Start the containers with:
To see the logs, run:
docker logs -f rsyslog