-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
80 lines (67 loc) · 3.39 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM golang:alpine3.20 AS builder
ENV DATAPLANE_MINOR 3.0.3
ENV DATAPLANE_V2_MINOR 2.9.8
ENV DATAPLANE_URL https://github.com/haproxytech/dataplaneapi.git
RUN apk add --no-cache ca-certificates git make && \
git clone "${DATAPLANE_URL}" "${GOPATH}/src/github.com/haproxytech/dataplaneapi" && \
cd "${GOPATH}/src/github.com/haproxytech/dataplaneapi" && \
git checkout "v${DATAPLANE_MINOR}" && \
make build && cp build/dataplaneapi /dataplaneapi && \
make clean && \
git checkout "v${DATAPLANE_V2_MINOR}" && \
make build && cp build/dataplaneapi /dataplaneapi-v2
FROM debian:bookworm-slim
MAINTAINER Dinko Korunic <dkorunic@haproxy.com>
LABEL Name HAProxy
LABEL Release Community Edition
LABEL Vendor HAProxy
LABEL Version 2.6.20
LABEL RUN /usr/bin/docker -d IMAGE
ENV HAPROXY_BRANCH 2.6
ENV HAPROXY_MINOR 2.6.20
ENV HAPROXY_SHA256 ef8c397a37fec4f7df1cfadc2c90f19f4cc2e4163ae7457c7b052da9f5a17a69
ENV HAPROXY_SRC_URL http://www.haproxy.org/download
ENV HAPROXY_UID haproxy
ENV HAPROXY_GID haproxy
ENV DEBIAN_FRONTEND noninteractive
COPY --from=builder /dataplaneapi /usr/local/bin/dataplaneapi
COPY --from=builder /dataplaneapi-v2 /usr/local/bin/dataplaneapi-v2
RUN apt-get update && \
apt-get install -y --no-install-recommends procps libssl3 zlib1g "libpcre2-*" liblua5.4-0 libatomic1 tar curl socat ca-certificates libjemalloc2 && \
apt-get install -y --no-install-recommends gcc make libc6-dev libssl-dev libpcre2-dev zlib1g-dev liblua5.4-dev libjemalloc-dev && \
c_rehash && \
curl -sfSL "${HAPROXY_SRC_URL}/${HAPROXY_BRANCH}/src/haproxy-${HAPROXY_MINOR}.tar.gz" -o haproxy.tar.gz && \
echo "$HAPROXY_SHA256 *haproxy.tar.gz" | sha256sum -c - && \
groupadd "$HAPROXY_GID" && \
useradd -g "$HAPROXY_GID" "$HAPROXY_UID" && \
mkdir -p /tmp/haproxy && \
tar -xzf haproxy.tar.gz -C /tmp/haproxy --strip-components=1 && \
rm -f haproxy.tar.gz && \
make -C /tmp/haproxy -j"$(nproc)" TARGET=linux-glibc CPU=generic USE_PCRE2=1 USE_PCRE2_JIT=1 \
USE_TFO=1 USE_LINUX_TPROXY=1 USE_LUA=1 USE_GETADDRINFO=1 \
USE_PROMEX=1 USE_SLZ=1 \
USE_OPENSSL=1 USE_PTHREAD_EMULATION=1 \
ADDLIB=-ljemalloc \
all && \
make -C /tmp/haproxy TARGET=linux-glibc install-bin install-man && \
ln -s /usr/local/sbin/haproxy /usr/sbin/haproxy && \
mkdir -p /var/lib/haproxy && \
chown "$HAPROXY_UID:$HAPROXY_GID" /var/lib/haproxy && \
mkdir -p /usr/local/etc/haproxy && \
ln -s /usr/local/etc/haproxy /etc/haproxy && \
cp -R /tmp/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors && \
rm -rf /tmp/haproxy && \
apt-get purge -y --auto-remove gcc make libc6-dev libssl-dev libpcre2-dev zlib1g-dev liblua5.4-dev libjemalloc-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
chmod +x /usr/local/bin/dataplaneapi && \
ln -s /usr/local/bin/dataplaneapi /usr/bin/dataplaneapi && \
chmod +x /usr/local/bin/dataplaneapi-v2 && \
ln -s /usr/local/bin/dataplaneapi-v2 /usr/bin/dataplaneapi-v2 && \
touch /usr/local/etc/haproxy/dataplaneapi.yml && \
chown "$HAPROXY_UID:$HAPROXY_GID" /usr/local/etc/haproxy/dataplaneapi.yml
COPY haproxy.cfg /usr/local/etc/haproxy
COPY docker-entrypoint.sh /
STOPSIGNAL SIGUSR1
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]