-
Notifications
You must be signed in to change notification settings - Fork 0
/
centos7-httpd24-haproxy24.Dockerfile
34 lines (31 loc) · 1.28 KB
/
centos7-httpd24-haproxy24.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Use CentOS 7 as the base image
FROM --platform=linux/amd64 centos:centos7.7.1908
# Set environment variable
ENV LD_LIBRARY_PATH=/usr/local/openssl11/lib
# Install EPEL repository, HTTPD and dependencies, and clean up
RUN yum -y install epel-release \
&& yum -y update \
&& yum -y install httpd mod_ssl procps iputils tree telnet less sudo wget gcc perl pcre-devel zlib-devel make \
&& yum clean all \
&& rm -rf /var/cache/yum
# Build HAProxy 2.4 with OpenSSL 1.1 to support HTTP/2
RUN cd /tmp \
&& wget https://www.openssl.org/source/openssl-1.1.1l.tar.gz \
&& tar xzvf openssl-1.1.1l.tar.gz \
&& cd openssl-1.1.1l \
&& ./config --prefix=/usr/local/openssl11 --openssldir=/usr/local/openssl11 \
&& make \
&& make install \
&& cd .. \
&& wget http://www.haproxy.org/download/2.4/src/haproxy-2.4.25.tar.gz \
&& tar xzvf haproxy-2.4.25.tar.gz \
&& cd haproxy-2.4.25 \
&& make TARGET=linux-glibc USE_OPENSSL=1 SSL_INC=/usr/local/openssl11/include SSL_LIB=/usr/local/openssl11/lib \
&& make install \
&& make install-bin \
&& ln -sf /usr/local/sbin/haproxy /usr/sbin/haproxy \
&& groupadd haproxy \
&& useradd -g haproxy haproxy \
&& mkdir -p /var/lib/haproxy \
&& chown haproxy:haproxy /var/lib/haproxy \
&& rm -rf /tmp/*