From 3d28277fa32ad38e68e4a9a3ee26bd563fc047f9 Mon Sep 17 00:00:00 2001 From: Dinko Korunic Date: Wed, 11 Sep 2024 14:51:16 +0000 Subject: [PATCH] Remove 2.0 branch. Bring back dataplaneapi v2 as /usr/local/bin/dataplaneapi-v2 --- .github/workflows/docker_manual.yml | 2 +- 2.0/Dockerfile | 82 ---------------------- 2.0/docker-entrypoint.sh | 17 ----- 2.0/haproxy.cfg | 102 ---------------------------- 2.2/Dockerfile | 9 ++- 2.4/Dockerfile | 9 ++- 2.6/Dockerfile | 13 ++-- 2.8/Dockerfile | 13 ++-- 2.9/Dockerfile | 13 ++-- 3.0/Dockerfile | 13 ++-- 3.1/Dockerfile | 13 ++-- build.sh | 2 +- update.sh | 11 ++- 13 files changed, 68 insertions(+), 231 deletions(-) delete mode 100644 2.0/Dockerfile delete mode 100755 2.0/docker-entrypoint.sh delete mode 100644 2.0/haproxy.cfg diff --git a/.github/workflows/docker_manual.yml b/.github/workflows/docker_manual.yml index acb09e5..19fcc4b 100644 --- a/.github/workflows/docker_manual.yml +++ b/.github/workflows/docker_manual.yml @@ -9,7 +9,7 @@ jobs: packages: write strategy: matrix: - branch: ["2.0", "2.2", "2.4", "2.6", "2.8", "2.9", "3.0", "3.1"] + branch: ["2.2", "2.4", "2.6", "2.8", "2.9", "3.0", "3.1"] env: DOCKER_PLATFORMS: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 DOCKER_IMAGE: haproxytech/haproxy-alpine diff --git a/2.0/Dockerfile b/2.0/Dockerfile deleted file mode 100644 index 3f96fe5..0000000 --- a/2.0/Dockerfile +++ /dev/null @@ -1,82 +0,0 @@ -FROM golang:alpine3.20 AS builder - -ENV DATAPLANE_MINOR 3.0.0 -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 - -FROM alpine:3.16 - -MAINTAINER Dinko Korunic - -LABEL Name HAProxy -LABEL Release Community Edition -LABEL Vendor HAProxy -LABEL Version 2.0.35 -LABEL RUN /usr/bin/docker -d IMAGE - -ENV HAPROXY_BRANCH 2.0 -ENV HAPROXY_MINOR 2.0.35 -ENV HAPROXY_SHA256 95334c52ace9ae139e66d60240633be8bb4eed1babedfcc6cb947092e00c447c -ENV HAPROXY_SRC_URL http://www.haproxy.org/download - -ENV LIBSLZ_MINOR 1.2.0 -ENV LIBSLZ_SHA256 723a8ef648ac5b30e5074c013ff61a5e5f54a5aafc9496f7dab9f6b02030bf24 -ENV LIBSLZ_URL https://github.com/wtarreau/libslz/archive/refs/tags - -ENV HAPROXY_UID haproxy -ENV HAPROXY_GID haproxy - -COPY --from=builder /dataplaneapi /usr/local/bin/dataplaneapi - -RUN apk add --no-cache ca-certificates && \ - apk add --no-cache --virtual build-deps gcc libc-dev \ - linux-headers lua5.3-dev make openssl openssl-dev pcre2-dev tar \ - zlib-dev curl shadow && \ - curl -sfSL "${LIBSLZ_URL}/v${LIBSLZ_MINOR}.tar.gz" -o libslz.tar.gz && \ - echo "$LIBSLZ_SHA256 *libslz.tar.gz" | sha256sum -c - && \ - mkdir -p /tmp/libslz && \ - tar -xzf libslz.tar.gz -C /tmp/libslz --strip-components=1 && \ - make -C /tmp/libslz static && \ - rm -f libslz.tar.gz && \ - 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-musl CPU=generic USE_PCRE2=1 USE_PCRE2_JIT=1 USE_REGPARM=1 USE_OPENSSL=1 \ - USE_TFO=1 USE_LINUX_TPROXY=1 USE_GETADDRINFO=1 \ - USE_LUA=1 LUA_LIB=/usr/lib/lua5.3 LUA_INC=/usr/include/lua5.3 \ - EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o" \ - USE_SLZ=1 SLZ_INC=/tmp/libslz/src SLZ_LIB=/tmp/libslz \ - all && \ - make -C /tmp/haproxy TARGET=linux2628 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/libslz && \ - rm -rf /tmp/haproxy && \ - chmod +x /usr/local/bin/dataplaneapi && \ - ln -s /usr/local/bin/dataplaneapi /usr/bin/dataplaneapi && \ - touch /usr/local/etc/haproxy/dataplaneapi.yml && \ - chown "$HAPROXY_UID:$HAPROXY_GID" /usr/local/etc/haproxy/dataplaneapi.yml && \ - apk del build-deps && \ - apk add --no-cache openssl zlib lua5.3-libs pcre2 && \ - rm -f /var/cache/apk/* - -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"] diff --git a/2.0/docker-entrypoint.sh b/2.0/docker-entrypoint.sh deleted file mode 100755 index 8b2093b..0000000 --- a/2.0/docker-entrypoint.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -set -e - -# first arg is `-f` or `--some-option` -if [ "${1#-}" != "$1" ]; then - set -- haproxy "$@" -fi - -if [ "$1" = 'haproxy' ]; then - shift # "haproxy" - # if the user wants "haproxy", let's add a couple useful flags - # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") - # -db -- disables background mode - set -- haproxy -W -db "$@" -fi - -exec "$@" diff --git a/2.0/haproxy.cfg b/2.0/haproxy.cfg deleted file mode 100644 index 6e2a0ea..0000000 --- a/2.0/haproxy.cfg +++ /dev/null @@ -1,102 +0,0 @@ -#--------------------------------------------------------------------- -# Example configuration for a possible web application. See the -# full configuration options online. -# -# https://www.haproxy.org/download/2.0/doc/configuration.txt -# https://cbonte.github.io/haproxy-dconv/2.0/configuration.html -# -#--------------------------------------------------------------------- - -#--------------------------------------------------------------------- -# Global settings -#--------------------------------------------------------------------- -global - # to have these messages end up in /var/log/haproxy.log you will - # need to: - # - # 1) configure syslog to accept network log events. This is done - # by adding the '-r' option to the SYSLOGD_OPTIONS in - # /etc/sysconfig/syslog - # - # 2) configure local2 events to go to the /var/log/haproxy.log - # file. A line like the following can be added to - # /etc/sysconfig/syslog - # - # local2.* /var/log/haproxy.log - # - log 127.0.0.1 local2 - - chroot /var/lib/haproxy - pidfile /var/run/haproxy.pid - maxconn 4000 - user haproxy - group haproxy - # daemon - - # turn on stats unix socket - stats socket /var/lib/haproxy/stats - -#--------------------------------------------------------------------- -# common defaults that all the 'listen' and 'backend' sections will -# use if not designated in their block -#--------------------------------------------------------------------- -defaults - mode http - log global - option httplog - option dontlognull - option http-server-close - option forwardfor except 127.0.0.0/8 - option redispatch - retries 3 - timeout http-request 10s - timeout queue 1m - timeout connect 10s - timeout client 1m - timeout server 1m - timeout http-keep-alive 10s - timeout check 10s - maxconn 3000 - -#--------------------------------------------------------------------- -# example how to define user and enable Data Plane API on tcp/5555 -# more information: https://github.com/haproxytech/dataplaneapi and -# https://www.haproxy.com/documentation/hapee/2-0r1/configuration/dataplaneapi/ -#--------------------------------------------------------------------- -# userlist haproxy-dataplaneapi -# user admin insecure-password mypassword -# -# program api -# command /usr/bin/dataplaneapi --host 0.0.0.0 --port 5555 --haproxy-bin /usr/sbin/haproxy --config-file /usr/local/etc/haproxy/haproxy.cfg --reload-cmd "kill -SIGUSR2 1" --restart-cmd "kill -SIGUSR2 1" --reload-delay 5 --userlist haproxy-dataplaneapi -# no option start-on-reload - -#--------------------------------------------------------------------- -# main frontend which proxys to the backends -#--------------------------------------------------------------------- -frontend main - bind *:80 - # bind *:443 ssl # To be completed .... - - acl url_static path_beg -i /static /images /javascript /stylesheets - acl url_static path_end -i .jpg .gif .png .css .js - - use_backend static if url_static - default_backend app - -#--------------------------------------------------------------------- -# static backend for serving up images, stylesheets and such -#--------------------------------------------------------------------- -backend static - balance roundrobin - server static1 127.0.0.1:4331 check - server static2 127.0.0.1:4332 check - -#--------------------------------------------------------------------- -# round robin balancing between the various backends -#--------------------------------------------------------------------- -backend app - balance roundrobin - server app1 127.0.0.1:5001 check - server app2 127.0.0.1:5002 check - server app3 127.0.0.1:5003 check - server app4 127.0.0.1:5004 check diff --git a/2.2/Dockerfile b/2.2/Dockerfile index ea52b85..5d41957 100644 --- a/2.2/Dockerfile +++ b/2.2/Dockerfile @@ -1,13 +1,17 @@ FROM golang:alpine3.20 AS 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 alpine:3.18 @@ -32,6 +36,7 @@ ENV HAPROXY_UID haproxy ENV HAPROXY_GID haproxy COPY --from=builder /dataplaneapi /usr/local/bin/dataplaneapi +COPY --from=builder /dataplaneapi-v2 /usr/local/bin/dataplaneapi-v2 RUN apk add --no-cache ca-certificates && \ apk add --no-cache --virtual build-deps gcc libc-dev \ @@ -68,6 +73,8 @@ RUN apk add --no-cache ca-certificates && \ rm -rf /tmp/haproxy && \ 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 && \ apk del build-deps && \ diff --git a/2.4/Dockerfile b/2.4/Dockerfile index dca8a64..4e868fc 100644 --- a/2.4/Dockerfile +++ b/2.4/Dockerfile @@ -1,13 +1,17 @@ FROM golang:alpine3.20 AS 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 alpine:3.20 @@ -28,6 +32,7 @@ ENV HAPROXY_UID haproxy ENV HAPROXY_GID haproxy COPY --from=builder /dataplaneapi /usr/local/bin/dataplaneapi +COPY --from=builder /dataplaneapi-v2 /usr/local/bin/dataplaneapi-v2 RUN apk add --no-cache ca-certificates jemalloc && \ apk add --no-cache --virtual build-deps gcc libc-dev \ @@ -57,6 +62,8 @@ RUN apk add --no-cache ca-certificates jemalloc && \ rm -rf /tmp/haproxy && \ 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 && \ apk del build-deps && \ diff --git a/2.6/Dockerfile b/2.6/Dockerfile index 33cac1a..6972953 100644 --- a/2.6/Dockerfile +++ b/2.6/Dockerfile @@ -1,13 +1,17 @@ FROM golang:alpine3.20 AS 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 alpine:3.20 @@ -24,14 +28,11 @@ ENV HAPROXY_MINOR 2.6.18 ENV HAPROXY_SHA256 1b36d3c618360eff7cdc2b70dd53affdf9c939d0fdf8602ac2d77018535f709a ENV HAPROXY_SRC_URL http://www.haproxy.org/download -ENV DATAPLANE_MINOR 3.0.0 -ENV DATAPLANE_SHA256 ec685350576898bb0a00d656f427f5da7c28043551a3e0050c1b5301547e235a -ENV DATAPLANE_URL https://github.com/haproxytech/dataplaneapi/releases/download - ENV HAPROXY_UID haproxy ENV HAPROXY_GID haproxy COPY --from=builder /dataplaneapi /usr/local/bin/dataplaneapi +COPY --from=builder /dataplaneapi-v2 /usr/local/bin/dataplaneapi-v2 RUN apk add --no-cache ca-certificates jemalloc && \ apk add --no-cache --virtual build-deps gcc libc-dev \ @@ -61,6 +62,8 @@ RUN apk add --no-cache ca-certificates jemalloc && \ rm -rf /tmp/haproxy && \ 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 && \ apk del build-deps && \ diff --git a/2.8/Dockerfile b/2.8/Dockerfile index d434920..7a11d4d 100644 --- a/2.8/Dockerfile +++ b/2.8/Dockerfile @@ -1,13 +1,17 @@ FROM golang:alpine3.20 AS 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 alpine:3.20 @@ -24,14 +28,11 @@ ENV HAPROXY_MINOR 2.8.10 ENV HAPROXY_SHA256 0d63cd46d9d10ac7dbc02f3c6769c1908f221e0a5c5b655a194655f7528d612a ENV HAPROXY_SRC_URL http://www.haproxy.org/download -ENV DATAPLANE_MINOR 3.0.0 -ENV DATAPLANE_SHA256 ec685350576898bb0a00d656f427f5da7c28043551a3e0050c1b5301547e235a -ENV DATAPLANE_URL https://github.com/haproxytech/dataplaneapi/releases/download - ENV HAPROXY_UID haproxy ENV HAPROXY_GID haproxy COPY --from=builder /dataplaneapi /usr/local/bin/dataplaneapi +COPY --from=builder /dataplaneapi-v2 /usr/local/bin/dataplaneapi-v2 RUN apk add --no-cache ca-certificates jemalloc && \ apk add --no-cache --virtual build-deps gcc libc-dev \ @@ -62,6 +63,8 @@ RUN apk add --no-cache ca-certificates jemalloc && \ rm -rf /tmp/haproxy && \ 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 && \ apk del build-deps && \ diff --git a/2.9/Dockerfile b/2.9/Dockerfile index 79bd0ab..b91ee68 100644 --- a/2.9/Dockerfile +++ b/2.9/Dockerfile @@ -1,13 +1,17 @@ FROM golang:alpine3.20 AS 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 alpine:3.20 @@ -24,14 +28,11 @@ ENV HAPROXY_MINOR 2.9.10 ENV HAPROXY_SHA256 c561b75e1031135dc773c7bbaeeef6e53d24a2accd27a0ebce5883cdb12640c0 ENV HAPROXY_SRC_URL http://www.haproxy.org/download -ENV DATAPLANE_MINOR 3.0.0 -ENV DATAPLANE_SHA256 ec685350576898bb0a00d656f427f5da7c28043551a3e0050c1b5301547e235a -ENV DATAPLANE_URL https://github.com/haproxytech/dataplaneapi/releases/download - ENV HAPROXY_UID haproxy ENV HAPROXY_GID haproxy COPY --from=builder /dataplaneapi /usr/local/bin/dataplaneapi +COPY --from=builder /dataplaneapi-v2 /usr/local/bin/dataplaneapi-v2 RUN apk add --no-cache ca-certificates jemalloc && \ apk add --no-cache --virtual build-deps gcc libc-dev \ @@ -62,6 +63,8 @@ RUN apk add --no-cache ca-certificates jemalloc && \ rm -rf /tmp/haproxy && \ 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 && \ apk del build-deps && \ diff --git a/3.0/Dockerfile b/3.0/Dockerfile index 2038880..d2bd2ea 100644 --- a/3.0/Dockerfile +++ b/3.0/Dockerfile @@ -1,13 +1,17 @@ FROM golang:alpine3.20 AS 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 alpine:3.20 @@ -24,14 +28,11 @@ ENV HAPROXY_MINOR 3.0.4 ENV HAPROXY_SHA256 aabfd98ada721bbfb68f7805586ced0373fb4c8d73e18faa94055a16c2096936 ENV HAPROXY_SRC_URL http://www.haproxy.org/download -ENV DATAPLANE_MINOR 3.0.0 -ENV DATAPLANE_SHA256 ec685350576898bb0a00d656f427f5da7c28043551a3e0050c1b5301547e235a -ENV DATAPLANE_URL https://github.com/haproxytech/dataplaneapi/releases/download - ENV HAPROXY_UID haproxy ENV HAPROXY_GID haproxy COPY --from=builder /dataplaneapi /usr/local/bin/dataplaneapi +COPY --from=builder /dataplaneapi-v2 /usr/local/bin/dataplaneapi-v2 RUN apk add --no-cache ca-certificates jemalloc && \ apk add --no-cache --virtual build-deps gcc libc-dev \ @@ -62,6 +63,8 @@ RUN apk add --no-cache ca-certificates jemalloc && \ rm -rf /tmp/haproxy && \ 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 && \ apk del build-deps && \ diff --git a/3.1/Dockerfile b/3.1/Dockerfile index c907a28..0a59e68 100644 --- a/3.1/Dockerfile +++ b/3.1/Dockerfile @@ -1,13 +1,17 @@ FROM golang:alpine3.20 AS 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 alpine:3.20 @@ -24,14 +28,11 @@ ENV HAPROXY_MINOR 3.1-dev7 ENV HAPROXY_SHA256 d6112b8b3f6041632c02ef89bd585184a4a1115d251a767fb18c01082bb0a4a0 ENV HAPROXY_SRC_URL http://www.haproxy.org/download -ENV DATAPLANE_MINOR 3.0.0 -ENV DATAPLANE_SHA256 ec685350576898bb0a00d656f427f5da7c28043551a3e0050c1b5301547e235a -ENV DATAPLANE_URL https://github.com/haproxytech/dataplaneapi/releases/download - ENV HAPROXY_UID haproxy ENV HAPROXY_GID haproxy COPY --from=builder /dataplaneapi /usr/local/bin/dataplaneapi +COPY --from=builder /dataplaneapi-v2 /usr/local/bin/dataplaneapi-v2 RUN apk add --no-cache ca-certificates jemalloc && \ apk add --no-cache --virtual build-deps gcc libc-dev \ @@ -62,6 +63,8 @@ RUN apk add --no-cache ca-certificates jemalloc && \ rm -rf /tmp/haproxy && \ 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 && \ apk del build-deps && \ diff --git a/build.sh b/build.sh index 59c5485..6d2df80 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ DOCKER_TAG="haproxytech/haproxy-alpine" HAPROXY_GITHUB_URL="https://github.com/haproxytech/haproxy-docker-alpine/blob/main" -HAPROXY_BRANCHES="2.0 2.2 2.4 2.6 2.8 2.9 3.0 3.1" +HAPROXY_BRANCHES="2.2 2.4 2.6 2.8 2.9 3.0 3.1" HAPROXY_CURRENT_BRANCH="3.0" PUSH="no" HAPROXY_UPDATED="" diff --git a/update.sh b/update.sh index 2e5cb87..8d3bc90 100755 --- a/update.sh +++ b/update.sh @@ -56,10 +56,19 @@ 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 +) + sed -r -i -e "s!^(ENV HAPROXY_SRC_URL) .*!\1 ${HAPROXY_SRC_URL}!; s!^(ENV HAPROXY_BRANCH) .*!\1 ${HAPROXY_BRANCH}!; s!^(ENV HAPROXY_MINOR) .*!\1 ${HAPROXY_MINOR}!; s!^(LABEL Version) .*!\1 ${HAPROXY_MINOR}!; s!^(ENV HAPROXY_SHA256) .*!\1 ${HAPROXY_SHA256}! - s!^(ENV DATAPLANE_MINOR) .*!\1 ${DATAPLANE_MINOR}!" \ + s!^(ENV DATAPLANE_MINOR) .*!\1 ${DATAPLANE_MINOR}! + s!^(ENV DATAPLANE_V2_MINOR) .*!\1 ${DATAPLANE_V2_MINOR}!" \ "$DOCKERFILE"