From 1d501d39853344e862706eaa983db01139614e13 Mon Sep 17 00:00:00 2001 From: Dinko Korunic Date: Wed, 11 Sep 2024 18:56:40 +0000 Subject: [PATCH] Remove 2.0 branch. Bring back dataplaneapi v2 as /usr/local/bin/dataplaneapi-v2. Update quictls to 3.1.7-quic1. --- 2.6/Dockerfile | 11 +++++++++-- 2.8/Dockerfile | 11 +++++++++-- 2.9/Dockerfile | 11 +++++++++-- 3.0/Dockerfile | 11 +++++++++-- 3.1/Dockerfile | 11 +++++++++-- update.sh | 9 +++++++++ 6 files changed, 54 insertions(+), 10 deletions(-) diff --git a/2.6/Dockerfile b/2.6/Dockerfile index 7cd0575..f5e63f2 100644 --- a/2.6/Dockerfile +++ b/2.6/Dockerfile @@ -1,17 +1,21 @@ FROM golang:alpine3.20 AS dataplaneapi-builder ENV DATAPLANE_MINOR 3.0.0 +ENV DATAPLANE_V2_MINOR 2.9.6 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 build && cp build/dataplaneapi /dataplaneapi && \ + make clean && \ + git checkout "v${DATAPLANE_V2_MINOR}" && \ + make build && cp build/dataplaneapi /dataplaneapi-v2 FROM debian:bookworm-slim AS openssl-builder -ENV OPENSSL_URL https://github.com/quictls/openssl/archive/refs/tags/openssl-3.1.5-quic1.tar.gz +ENV OPENSSL_URL https://github.com/quictls/openssl/archive/refs/tags/openssl-3.1.7-quic1.tar.gz ENV DEBIAN_FRONTEND noninteractive @@ -48,6 +52,7 @@ ENV HAPROXY_GID haproxy ENV DEBIAN_FRONTEND noninteractive COPY --from=dataplaneapi-builder /dataplaneapi /usr/local/bin/dataplaneapi +COPY --from=dataplaneapi-builder /dataplaneapi-v2 /usr/local/bin/dataplaneapi-v2 COPY --from=openssl-builder /opt/quictls /opt/quictls RUN apt-get update && \ @@ -80,6 +85,8 @@ RUN apt-get update && \ 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 && \ echo "/opt/quictls/lib" > /etc/ld.so.conf.d/quictls.conf && \ diff --git a/2.8/Dockerfile b/2.8/Dockerfile index cd3ffce..da3ca1b 100644 --- a/2.8/Dockerfile +++ b/2.8/Dockerfile @@ -1,17 +1,21 @@ FROM golang:alpine3.20 AS dataplaneapi-builder ENV DATAPLANE_MINOR 3.0.0 +ENV DATAPLANE_V2_MINOR 2.9.6 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 build && cp build/dataplaneapi /dataplaneapi && \ + make clean && \ + git checkout "v${DATAPLANE_V2_MINOR}" && \ + make build && cp build/dataplaneapi /dataplaneapi-v2 FROM debian:bookworm-slim AS openssl-builder -ENV OPENSSL_URL https://github.com/quictls/openssl/archive/refs/tags/openssl-3.1.5-quic1.tar.gz +ENV OPENSSL_URL https://github.com/quictls/openssl/archive/refs/tags/openssl-3.1.7-quic1.tar.gz ENV DEBIAN_FRONTEND noninteractive @@ -48,6 +52,7 @@ ENV HAPROXY_GID haproxy ENV DEBIAN_FRONTEND noninteractive COPY --from=dataplaneapi-builder /dataplaneapi /usr/local/bin/dataplaneapi +COPY --from=dataplaneapi-builder /dataplaneapi-v2 /usr/local/bin/dataplaneapi-v2 COPY --from=openssl-builder /opt/quictls /opt/quictls RUN apt-get update && \ @@ -80,6 +85,8 @@ RUN apt-get update && \ 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 && \ echo "/opt/quictls/lib" > /etc/ld.so.conf.d/quictls.conf && \ diff --git a/2.9/Dockerfile b/2.9/Dockerfile index 88bdef3..57e385a 100644 --- a/2.9/Dockerfile +++ b/2.9/Dockerfile @@ -1,17 +1,21 @@ FROM golang:alpine3.20 AS dataplaneapi-builder ENV DATAPLANE_MINOR 3.0.0 +ENV DATAPLANE_V2_MINOR 2.9.6 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 build && cp build/dataplaneapi /dataplaneapi && \ + make clean && \ + git checkout "v${DATAPLANE_V2_MINOR}" && \ + make build && cp build/dataplaneapi /dataplaneapi-v2 FROM debian:bookworm-slim AS openssl-builder -ENV OPENSSL_URL https://github.com/quictls/openssl/archive/refs/tags/openssl-3.1.5-quic1.tar.gz +ENV OPENSSL_URL https://github.com/quictls/openssl/archive/refs/tags/openssl-3.1.7-quic1.tar.gz ENV DEBIAN_FRONTEND noninteractive @@ -48,6 +52,7 @@ ENV HAPROXY_GID haproxy ENV DEBIAN_FRONTEND noninteractive COPY --from=dataplaneapi-builder /dataplaneapi /usr/local/bin/dataplaneapi +COPY --from=dataplaneapi-builder /dataplaneapi-v2 /usr/local/bin/dataplaneapi-v2 COPY --from=openssl-builder /opt/quictls /opt/quictls RUN apt-get update && \ @@ -80,6 +85,8 @@ RUN apt-get update && \ 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 && \ echo "/opt/quictls/lib" > /etc/ld.so.conf.d/quictls.conf && \ diff --git a/3.0/Dockerfile b/3.0/Dockerfile index af229b6..80bab42 100644 --- a/3.0/Dockerfile +++ b/3.0/Dockerfile @@ -1,17 +1,21 @@ FROM golang:alpine3.20 AS dataplaneapi-builder ENV DATAPLANE_MINOR 3.0.0 +ENV DATAPLANE_V2_MINOR 2.9.6 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 build && cp build/dataplaneapi /dataplaneapi && \ + make clean && \ + git checkout "v${DATAPLANE_V2_MINOR}" && \ + make build && cp build/dataplaneapi /dataplaneapi-v2 FROM debian:bookworm-slim AS openssl-builder -ENV OPENSSL_URL https://github.com/quictls/openssl/archive/refs/tags/openssl-3.1.5-quic1.tar.gz +ENV OPENSSL_URL https://github.com/quictls/openssl/archive/refs/tags/openssl-3.1.7-quic1.tar.gz ENV DEBIAN_FRONTEND noninteractive @@ -48,6 +52,7 @@ ENV HAPROXY_GID haproxy ENV DEBIAN_FRONTEND noninteractive COPY --from=dataplaneapi-builder /dataplaneapi /usr/local/bin/dataplaneapi +COPY --from=dataplaneapi-builder /dataplaneapi-v2 /usr/local/bin/dataplaneapi-v2 COPY --from=openssl-builder /opt/quictls /opt/quictls RUN apt-get update && \ @@ -80,6 +85,8 @@ RUN apt-get update && \ 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 && \ echo "/opt/quictls/lib" > /etc/ld.so.conf.d/quictls.conf && \ diff --git a/3.1/Dockerfile b/3.1/Dockerfile index 54c8821..fac3641 100644 --- a/3.1/Dockerfile +++ b/3.1/Dockerfile @@ -1,17 +1,21 @@ FROM golang:alpine3.20 AS dataplaneapi-builder ENV DATAPLANE_MINOR 3.0.0 +ENV DATAPLANE_V2_MINOR 2.9.6 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 build && cp build/dataplaneapi /dataplaneapi && \ + make clean && \ + git checkout "v${DATAPLANE_V2_MINOR}" && \ + make build && cp build/dataplaneapi /dataplaneapi-v2 FROM debian:bookworm-slim AS openssl-builder -ENV OPENSSL_URL https://github.com/quictls/openssl/archive/refs/tags/openssl-3.1.5-quic1.tar.gz +ENV OPENSSL_URL https://github.com/quictls/openssl/archive/refs/tags/openssl-3.1.7-quic1.tar.gz ENV DEBIAN_FRONTEND noninteractive @@ -48,6 +52,7 @@ ENV HAPROXY_GID haproxy ENV DEBIAN_FRONTEND noninteractive COPY --from=dataplaneapi-builder /dataplaneapi /usr/local/bin/dataplaneapi +COPY --from=dataplaneapi-builder /dataplaneapi-v2 /usr/local/bin/dataplaneapi-v2 COPY --from=openssl-builder /opt/quictls /opt/quictls RUN apt-get update && \ @@ -80,6 +85,8 @@ RUN apt-get update && \ 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 && \ echo "/opt/quictls/lib" > /etc/ld.so.conf.d/quictls.conf && \ diff --git a/update.sh b/update.sh index e44f86a..3a2d111 100755 --- a/update.sh +++ b/update.sh @@ -56,6 +56,14 @@ if [ -z "${DATAPLANE_MINOR}" ]; then exit 1 fi +DATAPLANE_SRC_URL="https://api.github.com/repos/haproxytech/dataplaneapi/releases" +DATAPLANE_V2_MINOR=$(curl -sfSL "$DATAPLANE_SRC_URL" | \ + grep '"tag_name":.*"v2' | \ + sed -E 's/.*"v?([^"]+)".*/\1/' | \ + sort -V | \ + tail -1 +) + OPENSSL_SRC_URL="https://api.github.com/repos/quictls/openssl/releases" OPENSSL_MINOR=$(curl -sfSL "$OPENSSL_SRC_URL" | \ grep '"tag_name":' | \ @@ -74,5 +82,6 @@ sed -r -i -e "s!^(ENV HAPROXY_SRC_URL) .*!\1 ${HAPROXY_SRC_URL}!; s!^(LABEL Version) .*!\1 ${HAPROXY_MINOR}!; s!^(ENV HAPROXY_SHA256) .*!\1 ${HAPROXY_SHA256}! s!^(ENV DATAPLANE_MINOR) .*!\1 ${DATAPLANE_MINOR}! + s!^(ENV DATAPLANE_V2_MINOR) .*!\1 ${DATAPLANE_V2_MINOR}! s!^(ENV OPENSSL_MINOR) .*!\1 ${OPENSSL_MINOR}!" \ "$DOCKERFILE"