In previous post, we have seen what is HAProxy and how to install and configure it. In this post will see about how to run haproxy on docker container. Docker is simplified solution tool for any kind of application, we can easily deploy/redeploy at any time. Also, we cannot avoid docker on fast driving infrastructure. Find detailed explanation about Haproxy on previous post.
There are multiple ways to run the haproxy on docker. We can use docker-engine or docker-compose or docker-swarm. In this will discuss about it one by one.
Run using Docker-Engine
To run the haproxy on docker container, we can use existing docker image (official) or we must write our own based on our environment or requirement. In this will use official image and also will use it as base image and create the docker image.
To run HAProxy with official image:
# docker run -d --name haproxy haproxy:latest ##--> latest version is 1.9.0
Create Own dockerfile based on haproxy,
Read More on: https://foxutech.com/how-to-load-balancing-applications-with-haproxy-and-docker/