|
1 | | -FROM golang:alpine AS builder |
| 1 | +FROM alpine:3.20 AS awslc-builder |
2 | 2 |
|
3 | | -ENV DATAPLANE_MINOR 3.0.15 |
4 | | -ENV DATAPLANE_V2_MINOR 2.9.19 |
5 | | -ENV DATAPLANE_URL https://github.com/haproxytech/dataplaneapi.git |
6 | | - |
7 | | -RUN apk add --no-cache ca-certificates git make && \ |
8 | | - git clone "${DATAPLANE_URL}" "${GOPATH}/src/github.com/haproxytech/dataplaneapi" && \ |
9 | | - cd "${GOPATH}/src/github.com/haproxytech/dataplaneapi" && \ |
10 | | - git checkout "v${DATAPLANE_MINOR}" && \ |
11 | | - make build && cp build/dataplaneapi /dataplaneapi && \ |
12 | | - make clean && \ |
13 | | - git checkout "v${DATAPLANE_V2_MINOR}" && \ |
14 | | - make build && cp build/dataplaneapi /dataplaneapi-v2 |
| 3 | +ENV AWSLC_URL=https://github.com/aws/aws-lc.git |
| 4 | +ENV AWSLC_TAG=v1.65.1 |
15 | 5 |
|
16 | | -FROM alpine:3.20 |
| 6 | +RUN apk add --no-cache curl build-base make autoconf automake gcc libc-dev linux-headers git cmake samurai go && \ |
| 7 | + git clone --depth 1 --branch "${AWSLC_TAG}" "${AWSLC_URL}" /tmp/aws-lc && \ |
| 8 | + mkdir /tmp/aws-lc/build && \ |
| 9 | + cd /tmp/aws-lc/build && \ |
| 10 | + cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/opt/aws-lc -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON .. && \ |
| 11 | + ninja install && \ |
| 12 | + rm -rf /tmp/aws-lc |
17 | 13 |
|
18 | | -MAINTAINER Dinko Korunic <dkorunic@haproxy.com> |
19 | | - |
20 | | -LABEL Name HAProxy |
21 | | -LABEL Release Community Edition |
22 | | -LABEL Vendor HAProxy |
23 | | -LABEL Version 3.0.12 |
24 | | -LABEL RUN /usr/bin/docker -d IMAGE |
| 14 | +FROM alpine:3.20 AS hapce-builder |
25 | 15 |
|
26 | 16 | ENV HAPROXY_BRANCH 3.0 |
27 | 17 | ENV HAPROXY_MINOR 3.0.12 |
28 | 18 | ENV HAPROXY_SHA256 cd2bade59a7e2d61f2d62be7c6c4cfc0e2b3a90431023720cae7c43843b0570b |
29 | 19 | ENV HAPROXY_SRC_URL http://www.haproxy.org/download |
30 | 20 |
|
31 | | -ENV HAPROXY_UID haproxy |
32 | | -ENV HAPROXY_GID haproxy |
33 | | - |
34 | | -COPY --from=builder /dataplaneapi /usr/local/bin/dataplaneapi |
35 | | -COPY --from=builder /dataplaneapi-v2 /usr/local/bin/dataplaneapi-v2 |
| 21 | +COPY --from=awslc-builder /opt/aws-lc /opt/aws-lc |
36 | 22 |
|
37 | 23 | RUN apk add --no-cache ca-certificates jemalloc && \ |
38 | 24 | apk add --no-cache --virtual build-deps gcc libc-dev \ |
39 | 25 | linux-headers lua5.4-dev make openssl openssl-dev pcre2-dev tar \ |
40 | 26 | zlib-dev curl shadow jemalloc-dev && \ |
41 | 27 | curl -sfSL "${HAPROXY_SRC_URL}/${HAPROXY_BRANCH}/src/haproxy-${HAPROXY_MINOR}.tar.gz" -o haproxy.tar.gz && \ |
42 | 28 | echo "$HAPROXY_SHA256 *haproxy.tar.gz" | sha256sum -c - && \ |
43 | | - groupadd "$HAPROXY_GID" && \ |
44 | | - useradd -g "$HAPROXY_GID" "$HAPROXY_UID" && \ |
45 | 29 | mkdir -p /tmp/haproxy && \ |
46 | 30 | tar -xzf haproxy.tar.gz -C /tmp/haproxy --strip-components=1 && \ |
47 | 31 | rm -f haproxy.tar.gz && \ |
48 | 32 | make -C /tmp/haproxy -j"$(nproc)" TARGET=linux-musl CPU=generic USE_PCRE2=1 USE_PCRE2_JIT=1 \ |
49 | 33 | USE_TFO=1 USE_LINUX_TPROXY=1 USE_GETADDRINFO=1 \ |
50 | 34 | USE_LUA=1 LUA_LIB=/usr/lib/lua5.4 LUA_INC=/usr/include/lua5.4 \ |
51 | 35 | USE_PROMEX=1 USE_SLZ=1 \ |
52 | | - USE_OPENSSL=1 USE_PTHREAD_EMULATION=1 \ |
53 | | - USE_QUIC=1 USE_QUIC_OPENSSL_COMPAT=1 \ |
| 36 | + USE_OPENSSL_AWSLC=1 USE_PTHREAD_EMULATION=1 \ |
| 37 | + SSL_INC=/opt/aws-lc/include SSL_LIB=/opt/aws-lc/lib USE_QUIC=1 \ |
| 38 | + LDFLAGS="-L/opt/aws-lc/lib -Wl,-rpath,/opt/aws-lc/lib" \ |
54 | 39 | ADDLIB=-ljemalloc \ |
55 | 40 | all && \ |
56 | | - make -C /tmp/haproxy TARGET=linux2628 install-bin install-man && \ |
| 41 | + make -C /tmp/haproxy TARGET=linux2628 install-bin |
| 42 | + |
| 43 | +FROM alpine:3.20 |
| 44 | + |
| 45 | +MAINTAINER Dinko Korunic <dkorunic@haproxy.com> |
| 46 | + |
| 47 | +LABEL Name HAProxy |
| 48 | +LABEL Release Community Edition |
| 49 | +LABEL Vendor HAProxy |
| 50 | +LABEL Version 3.0.12 |
| 51 | +LABEL RUN /usr/bin/docker -d IMAGE |
| 52 | + |
| 53 | +ENV HAPROXY_BRANCH 3.0 |
| 54 | +ENV HAPROXY_MINOR 3.0.12 |
| 55 | +ENV HAPROXY_SHA256 cd2bade59a7e2d61f2d62be7c6c4cfc0e2b3a90431023720cae7c43843b0570b |
| 56 | +ENV HAPROXY_SRC_URL http://www.haproxy.org/download |
| 57 | + |
| 58 | +ENV HAPROXY_UID haproxy |
| 59 | +ENV HAPROXY_GID haproxy |
| 60 | + |
| 61 | +ENV DATAPLANE_MINOR 3.0.15 |
| 62 | +ENV DATAPLANE_URL https://github.com/haproxytech/dataplaneapi/releases/download |
| 63 | + |
| 64 | +ARG TARGETPLATFORM |
| 65 | + |
| 66 | +COPY --from=awslc-builder /opt/aws-lc /opt/aws-lc |
| 67 | +COPY --from=hapce-builder /usr/local/sbin/haproxy /usr/local/sbin/haproxy |
| 68 | +COPY --from=hapce-builder /tmp/haproxy/examples/errorfiles/ /usr/local/etc/haproxy/errors |
| 69 | + |
| 70 | +RUN apk add --no-cache ca-certificates jemalloc zlib lua5.4-libs pcre2 shadow curl && \ |
| 71 | + groupadd "$HAPROXY_GID" && \ |
| 72 | + useradd -g "$HAPROXY_GID" "$HAPROXY_UID" && \ |
| 73 | + chmod +x /usr/local/sbin/haproxy && \ |
57 | 74 | ln -s /usr/local/sbin/haproxy /usr/sbin/haproxy && \ |
58 | 75 | mkdir -p /var/lib/haproxy && \ |
59 | 76 | chown "$HAPROXY_UID:$HAPROXY_GID" /var/lib/haproxy && \ |
60 | 77 | mkdir -p /usr/local/etc/haproxy && \ |
61 | 78 | ln -s /usr/local/etc/haproxy /etc/haproxy && \ |
62 | | - cp -R /tmp/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors && \ |
63 | | - rm -rf /tmp/haproxy && \ |
| 79 | + case "${TARGETPLATFORM}" in \ |
| 80 | + "linux/arm64") API_ARCH=arm64 ;; \ |
| 81 | + "linux/amd64") API_ARCH=x86_64 ;; \ |
| 82 | + "linux/arm/v6") API_ARCH=arm ;; \ |
| 83 | + "linux/arm/v7") API_ARCH=arm ;; \ |
| 84 | + *) echo "ARG TARGETPLATFORM undeclared" >&2 && exit 1 ;; \ |
| 85 | + esac && \ |
| 86 | + curl -sfSL "${DATAPLANE_URL}/v${DATAPLANE_MINOR}/dataplaneapi_${DATAPLANE_MINOR}_linux_${API_ARCH}.tar.gz" -o dataplaneapi.tar.gz && \ |
| 87 | + mkdir -p /tmp/dataplaneapi && \ |
| 88 | + tar -xzf dataplaneapi.tar.gz -C /tmp/dataplaneapi && \ |
| 89 | + rm -f dataplaneapi.tar.gz && \ |
| 90 | + cp /tmp/dataplaneapi/dataplaneapi /usr/local/bin/dataplaneapi && \ |
64 | 91 | chmod +x /usr/local/bin/dataplaneapi && \ |
65 | | - ln -s /usr/local/bin/dataplaneapi /usr/bin/dataplaneapi && \ |
66 | | - chmod +x /usr/local/bin/dataplaneapi-v2 && \ |
67 | | - ln -s /usr/local/bin/dataplaneapi-v2 /usr/bin/dataplaneapi-v2 && \ |
68 | 92 | touch /usr/local/etc/haproxy/dataplaneapi.yml && \ |
69 | 93 | chown "$HAPROXY_UID:$HAPROXY_GID" /usr/local/etc/haproxy/dataplaneapi.yml && \ |
70 | | - apk del build-deps && \ |
71 | | - apk add --no-cache openssl zlib lua5.4-libs pcre2 && \ |
72 | | - rm -f /var/cache/apk/* |
| 94 | + mkdir -p /usr/local/var/lib/dataplaneapi && \ |
| 95 | + chown "$HAPROXY_UID:$HAPROXY_GID" /usr/local/var/lib/dataplaneapi && \ |
| 96 | + ln -s /usr/local/var/lib/dataplaneapi /var/lib/dataplaneapi && \ |
| 97 | + rm -rf /tmp/dataplaneapi && \ |
| 98 | + rm -f /var/cache/apk/* && \ |
| 99 | + echo "/lib:/usr/local/lib:/usr/lib:/opt/aws-lc/lib" > "/etc/ld-musl-$(uname -m).path" && \ |
| 100 | + mkdir -p /opt/aws-lc/ssl && \ |
| 101 | + rm -rf /opt/aws-lc/ssl/certs && \ |
| 102 | + ln -s /etc/ssl/certs /opt/aws-lc/ssl/certs |
73 | 103 |
|
74 | 104 | COPY haproxy.cfg /usr/local/etc/haproxy |
75 | 105 | COPY docker-entrypoint.sh / |
|
0 commit comments