Skip to content

Commit

Permalink
Remove 2.0 branch. Bring back dataplaneapi v2 as /usr/local/bin/datap…
Browse files Browse the repository at this point in the history
…laneapi-v2. Update quictls to 3.1.7-quic1.
  • Loading branch information
dkorunic committed Sep 11, 2024
1 parent dca5cf9 commit 1d501d3
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 10 deletions.
11 changes: 9 additions & 2 deletions 2.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 && \
Expand Down Expand Up @@ -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 && \
Expand Down
11 changes: 9 additions & 2 deletions 2.8/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 && \
Expand Down Expand Up @@ -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 && \
Expand Down
11 changes: 9 additions & 2 deletions 2.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 && \
Expand Down Expand Up @@ -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 && \
Expand Down
11 changes: 9 additions & 2 deletions 3.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 && \
Expand Down Expand Up @@ -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 && \
Expand Down
11 changes: 9 additions & 2 deletions 3.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 && \
Expand Down Expand Up @@ -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 && \
Expand Down
9 changes: 9 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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":' | \
Expand All @@ -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"

0 comments on commit 1d501d3

Please sign in to comment.