制作haproxy镜像

制作haproxy镜像

FROM centos-base:7.7.1908

LABEL maintanier="miaosen.guo 952726682@qq.com"

RUN yum install -y  epel-release && yum install -y vim wget tree lrzsz gcc gcc-c++ automake proc proc-devel zlib zlib-devel openssl openssl-devel iproute net-tools iotop unzip screen tcpdump 

ADD haproxy-2.0.5.tar.gz /usr/local/src/

RUN cd /usr/local/src/haproxy-2.0.5 && make ARCH=x86_64 TARGET=linux-glibc USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_SYSTEMD=1 USE_CPU_AFFINITY=1 PREFIX=/usr/local/haproxy && make install PREFIX=/usr/local/haproxy &&cp haproxy /usr/sbin && make /usr/local/haproxy/run

ADD haproxy.cfg /etc/haproxy

ADD run_haproxy.sh /etc/haproxy
EXPOSE 80 9999
CMD ["/usr/bin.run_haproxy.sh"]

haproxy.sh

#!/bin/bash
/usr/local/haproxy/sbin/haproxy -f /etc/local/haproxy/haproxy.cfg

tail -f /etc/hosts
posted @ 2020-08-09 15:21  Gmiao  阅读(75)  评论(0编辑  收藏  举报