Skip to content

Commit df5f35e

Browse files
authored
Update to 2.8.1 - OpenSSL 3.1.1 and moved to debian12 (#46)
1 parent 2cb63fd commit df5f35e

File tree

4 files changed

+32
-35
lines changed

4 files changed

+32
-35
lines changed

Dockerfile

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
1-
FROM rockylinux:latest
1+
FROM debian:12
22

3-
ENV HAPROXY_MJR_VERSION=2.4 \
4-
HAPROXY_VERSION=2.4.16 \
3+
ENV HAPROXY_MJR_VERSION=2.8 \
4+
HAPROXY_VERSION=2.8.1 \
55
HAPROXY_CONFIG='/etc/haproxy/haproxy.cfg' \
66
HAPROXY_ADDITIONAL_CONFIG='' \
77
HAPROXY_PRE_RESTART_CMD='' \
88
HAPROXY_POST_RESTART_CMD='' \
9-
OPENSSL_VERSION=3.0.2
9+
OPENSSL_VERSION=3.1.1
1010

1111
RUN \
12-
yum install -y epel-release && \
13-
yum update -y && \
12+
apt update && \
1413
`# Install build tools. Note: perl needed to compile openssl...` \
15-
yum install -y \
14+
apt install -y \
1615
inotify-tools \
1716
wget \
1817
tar \
1918
gzip \
2019
make \
2120
gcc \
2221
perl \
23-
pcre-devel \
24-
zlib-devel \
22+
libpcre3-dev \
23+
zlib1g-dev \
2524
iptables \
2625
socat \
27-
nc \
26+
netcat-traditional \
2827
telnet \
2928
mtr && \
3029
`# Install newest openssl...` \
3130
wget -O /tmp/openssl.tgz https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz && \
3231
tar -zxf /tmp/openssl.tgz -C /tmp && \
3332
cd /tmp/openssl-* && \
3433
./config \
35-
--openssldir=/etc/pki/tls \
34+
--openssldir=/etc/ssl \
3635
no-shared zlib-dynamic && \
3736
make -j$(getconf _NPROCESSORS_ONLN) V= && make install_sw && \
3837
cd && rm -rf /tmp/openssl* && \
3938
wget -O /tmp/haproxy.tgz http://www.haproxy.org/download/${HAPROXY_MJR_VERSION}/src/haproxy-${HAPROXY_VERSION}.tar.gz && \
4039
tar -zxvf /tmp/haproxy.tgz -C /tmp && \
4140
cd /tmp/haproxy-* && \
4241
make \
43-
-j$(getconf _NPROCESSORS_ONLN) V= \
44-
TARGET=linux-glibc \
45-
USE_LINUX_TPROXY=1 \
46-
USE_ZLIB=1 \
47-
USE_REGPARM=1 \
48-
USE_PCRE=1 \
49-
USE_PCRE_JIT=1 \
50-
USE_OPENSSL=1 \
51-
ADDLIB=-ldl \
52-
ADDLIB=-lpthread && make install && \
42+
-j$(getconf _NPROCESSORS_ONLN) V= \
43+
TARGET=linux-glibc \
44+
USE_LINUX_TPROXY=1 \
45+
USE_ZLIB=1 \
46+
USE_REGPARM=1 \
47+
USE_PCRE=1 \
48+
USE_PCRE_JIT=1 \
49+
USE_OPENSSL=1 \
50+
ADDLIB=-ldl \
51+
ADDLIB=-lpthread && make install && \
5352
rm -rf /tmp/haproxy* && \
5453
mkdir -p /var/lib/haproxy && \
55-
groupadd haproxy && adduser haproxy -g haproxy && chown -R haproxy:haproxy /var/lib/haproxy && \
56-
openssl genrsa -out /etc/pki/tls/dummy.key 2048 && \
57-
openssl req -new -key /etc/pki/tls/dummy.key -out /etc/pki/tls/dummy.csr -subj "/C=GB/L=London/O=Company Ltd/CN=haproxy" && \
58-
openssl x509 -req -days 3650 -in /etc/pki/tls/dummy.csr -signkey /etc/pki/tls/dummy.key -out /etc/pki/tls/dummy.crt && \
59-
cat /etc/pki/tls/dummy.crt /etc/pki/tls/dummy.key > /etc/pki/tls/dummy.pem && \
60-
yum remove -y make gcc pcre-devel && \
61-
yum clean all && rm -rf /var/cache/yum
54+
adduser --no-create-home --disabled-password --gecos "" haproxy && adduser haproxy haproxy && chown -R haproxy:haproxy /var/lib/haproxy && \
55+
mkdir -p /etc/pki/tls && \
56+
openssl genrsa -out /etc/ssl/private/dummy.key 2048 && \
57+
openssl req -new -key /etc/ssl/private/dummy.key -out /etc/ssl/private/dummy.csr -subj "/C=GB/L=London/O=Company Ltd/CN=haproxy" && \
58+
openssl x509 -req -days 3650 -in /etc/ssl/private/dummy.csr -signkey /etc/ssl/private/dummy.key -out /etc/ssl/private/dummy.crt && \
59+
cat /etc/ssl/private/dummy.crt /etc/ssl/private/dummy.key > /etc/ssl/private/dummy.pem && \
60+
apt remove -y make gcc libpcre3-dev && \
61+
apt clean -y
6262

6363
COPY container-files /
6464

Tests/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# Launch Nginx backend server
23
nginx:
34
image: million12/nginx
@@ -7,7 +8,6 @@ nginx:
78
environment:
89
- NGINX_GENERATE_DEFAULT_VHOST=true
910

10-
1111
# Launch HAProxy
1212
haproxy:
1313
cap_add:

container-files/bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -u
44

container-files/etc/haproxy/haproxy.cfg

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,10 @@ frontend http-in
4848

4949
frontend https-in
5050
mode tcp
51-
bind *:443 ssl crt /etc/pki/tls/dummy.pem alpn h2,http/1.1
52-
use_backend nodes-http2 if { ssl_fc_alpn -i h2 }
51+
bind *:443 ssl crt /etc/ssl/private/dummy.pem alpn h2,http/1.1
52+
use_backend nodes-http if { ssl_fc_alpn -i h2 }
5353
default_backend nodes-http
5454

5555
backend nodes-http
5656
server node1 web.server:80 check
5757

58-
backend nodes-http2
59-
mode tcp
60-
server node1 web.server:81 check send-proxy

0 commit comments

Comments
 (0)