Skip to content

Commit b8e8a52

Browse files
committed
Add s6 type of images. Upgrade to trixie.
1 parent a034c1f commit b8e8a52

File tree

82 files changed

+1406
-29
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1406
-29
lines changed

.github/workflows/docker_auto.yml

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- "[0-9]+.[0-9]+-dev[0-9]+"
77
jobs:
88
main:
9-
runs-on: ubuntu-22.04
9+
runs-on: large_runner
1010
permissions:
1111
contents: read
1212
packages: write
@@ -84,7 +84,47 @@ jobs:
8484
ghcr.io/${{ github.repository }}:${{ env.BUILD_BRANCH }}
8585
ghcr.io/${{ github.repository }}:${{ env.BUILD_VER }}
8686
cache-from: type=local,src=/tmp/.buildx-cache
87-
cache-to: type=local,dest=/tmp/.buildx-cache-new
87+
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
88+
89+
- name: Move cache
90+
if: ${{ env.BUILD_BRANCH == env.STABLE_BRANCH }}
91+
run: |
92+
rm -rf /tmp/.buildx-cache
93+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
94+
95+
- name: Build and push latest stable branch for s6
96+
if: ${{ env.BUILD_BRANCH == env.STABLE_BRANCH }}
97+
id: docker_build_latest_s6
98+
uses: docker/build-push-action@v6
99+
with:
100+
context: ${{ env.BUILD_BRANCH }}
101+
file: ${{ env.BUILD_BRANCH }}/Dockerfile.api
102+
builder: ${{ steps.buildx.outputs.name }}
103+
platforms: ${{ env.DOCKER_PLATFORMS }}
104+
push: true
105+
labels: |
106+
org.opencontainers.image.authors=${{ github.repository_owner }}
107+
org.opencontainers.image.created=${{ env.BUILD_DATE }}
108+
org.opencontainers.image.description=Created from commit ${{ env.GIT_SHA }} and ref ${{ env.GIT_REF }}
109+
org.opencontainers.image.ref.name=${{ env.GIT_REF }}
110+
org.opencontainers.image.revision=${{ github.sha }}
111+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
112+
org.opencontainers.image.version=${{ env.BUILD_VER }}
113+
tags: |
114+
${{ env.DOCKER_IMAGE }}:s6-latest
115+
${{ env.DOCKER_IMAGE }}:s6-${{ env.BUILD_BRANCH }}
116+
${{ env.DOCKER_IMAGE }}:s6-${{ env.BUILD_VER }}
117+
ghcr.io/${{ github.repository }}:s6-latest
118+
ghcr.io/${{ github.repository }}:s6-${{ env.BUILD_BRANCH }}
119+
ghcr.io/${{ github.repository }}:s6-${{ env.BUILD_VER }}
120+
cache-from: type=local,src=/tmp/.buildx-cache
121+
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
122+
123+
- name: Move cache for s6
124+
if: ${{ env.BUILD_BRANCH == env.STABLE_BRANCH }}
125+
run: |
126+
rm -rf /tmp/.buildx-cache
127+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
88128
89129
- name: Build and push everything else
90130
if: ${{ env.BUILD_BRANCH != env.STABLE_BRANCH }}
@@ -110,9 +150,42 @@ jobs:
110150
ghcr.io/${{ github.repository }}:${{ env.BUILD_BRANCH }}
111151
ghcr.io/${{ github.repository }}:${{ env.BUILD_VER }}
112152
cache-from: type=local,src=/tmp/.buildx-cache
113-
cache-to: type=local,dest=/tmp/.buildx-cache-new
153+
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
114154

115155
- name: Move cache
156+
if: ${{ env.BUILD_BRANCH != env.STABLE_BRANCH }}
157+
run: |
158+
rm -rf /tmp/.buildx-cache
159+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
160+
161+
- name: Build and push everything else for s6
162+
if: ${{ env.BUILD_BRANCH != env.STABLE_BRANCH }}
163+
id: docker_build_regular_s6
164+
uses: docker/build-push-action@v6
165+
with:
166+
context: ${{ env.BUILD_BRANCH }}
167+
file: ${{ env.BUILD_BRANCH }}/Dockerfile.api
168+
builder: ${{ steps.buildx.outputs.name }}
169+
platforms: ${{ env.DOCKER_PLATFORMS }}
170+
push: true
171+
labels: |
172+
org.opencontainers.image.authors=${{ github.repository_owner }}
173+
org.opencontainers.image.created=${{ env.BUILD_DATE }}
174+
org.opencontainers.image.description=Created from commit ${{ env.GIT_SHA }} and ref ${{ env.GIT_REF }}
175+
org.opencontainers.image.ref.name=${{ env.GIT_REF }}
176+
org.opencontainers.image.revision=${{ github.sha }}
177+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
178+
org.opencontainers.image.version=${{ env.BUILD_VER }}
179+
tags: |
180+
${{ env.DOCKER_IMAGE }}:s6-${{ env.BUILD_BRANCH }}
181+
${{ env.DOCKER_IMAGE }}:s6-${{ env.BUILD_VER }}
182+
ghcr.io/${{ github.repository }}:s6-${{ env.BUILD_BRANCH }}
183+
ghcr.io/${{ github.repository }}:s6-${{ env.BUILD_VER }}
184+
cache-from: type=local,src=/tmp/.buildx-cache
185+
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
186+
187+
- name: Move cache for s6
188+
if: ${{ env.BUILD_BRANCH != env.STABLE_BRANCH }}
116189
run: |
117190
rm -rf /tmp/.buildx-cache
118191
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

.github/workflows/docker_description.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99
jobs:
1010
main:
11-
runs-on: ubuntu-22.04
11+
runs-on: large_runner
1212
env:
1313
DOCKER_IMAGE: haproxytech/haproxy-debian
1414
steps:

.github/workflows/docker_manual.yml

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_dispatch:
44
jobs:
55
main:
6-
runs-on: ubuntu-22.04
6+
runs-on: large_runner
77
permissions:
88
contents: read
99
packages: write
@@ -84,7 +84,47 @@ jobs:
8484
ghcr.io/${{ github.repository }}:${{ env.BUILD_BRANCH }}
8585
ghcr.io/${{ github.repository }}:${{ env.BUILD_VER }}
8686
cache-from: type=local,src=/tmp/.buildx-cache
87-
cache-to: type=local,dest=/tmp/.buildx-cache-new
87+
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
88+
89+
- name: Move cache
90+
if: ${{ env.BUILD_BRANCH == env.STABLE_BRANCH }}
91+
run: |
92+
rm -rf /tmp/.buildx-cache
93+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
94+
95+
- name: Build and push latest stable branch for s6
96+
if: ${{ env.BUILD_BRANCH == env.STABLE_BRANCH }}
97+
id: docker_build_latest_s6
98+
uses: docker/build-push-action@v6
99+
with:
100+
context: ${{ env.BUILD_BRANCH }}
101+
file: ${{ env.BUILD_BRANCH }}/Dockerfile.api
102+
builder: ${{ steps.buildx.outputs.name }}
103+
platforms: ${{ env.DOCKER_PLATFORMS }}
104+
push: true
105+
labels: |
106+
org.opencontainers.image.authors=${{ github.repository_owner }}
107+
org.opencontainers.image.created=${{ env.BUILD_DATE }}
108+
org.opencontainers.image.description=Created from commit ${{ env.GIT_SHA }} and ref ${{ env.GIT_REF }}
109+
org.opencontainers.image.ref.name=${{ env.GIT_REF }}
110+
org.opencontainers.image.revision=${{ github.sha }}
111+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
112+
org.opencontainers.image.version=${{ env.BUILD_VER }}
113+
tags: |
114+
${{ env.DOCKER_IMAGE }}:s6-latest
115+
${{ env.DOCKER_IMAGE }}:s6-${{ env.BUILD_BRANCH }}
116+
${{ env.DOCKER_IMAGE }}:s6-${{ env.BUILD_VER }}
117+
ghcr.io/${{ github.repository }}:s6-latest
118+
ghcr.io/${{ github.repository }}:s6-${{ env.BUILD_BRANCH }}
119+
ghcr.io/${{ github.repository }}:s6-${{ env.BUILD_VER }}
120+
cache-from: type=local,src=/tmp/.buildx-cache
121+
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
122+
123+
- name: Move cache
124+
if: ${{ env.BUILD_BRANCH == env.STABLE_BRANCH }}
125+
run: |
126+
rm -rf /tmp/.buildx-cache
127+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
88128
89129
- name: Build and push everything else
90130
if: ${{ env.BUILD_BRANCH != env.STABLE_BRANCH }}
@@ -110,9 +150,42 @@ jobs:
110150
ghcr.io/${{ github.repository }}:${{ env.BUILD_BRANCH }}
111151
ghcr.io/${{ github.repository }}:${{ env.BUILD_VER }}
112152
cache-from: type=local,src=/tmp/.buildx-cache
113-
cache-to: type=local,dest=/tmp/.buildx-cache-new
153+
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
114154

115-
- name: Move cache
155+
- name: Move cache for s6
156+
if: ${{ env.BUILD_BRANCH != env.STABLE_BRANCH }}
157+
run: |
158+
rm -rf /tmp/.buildx-cache
159+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
160+
161+
- name: Build and push everything else for s6
162+
if: ${{ env.BUILD_BRANCH != env.STABLE_BRANCH }}
163+
id: docker_build_regular_s6
164+
uses: docker/build-push-action@v6
165+
with:
166+
context: ${{ env.BUILD_BRANCH }}
167+
file: ${{ env.BUILD_BRANCH }}/Dockerfile.api
168+
builder: ${{ steps.buildx.outputs.name }}
169+
platforms: ${{ env.DOCKER_PLATFORMS }}
170+
push: true
171+
labels: |
172+
org.opencontainers.image.authors=${{ github.repository_owner }}
173+
org.opencontainers.image.created=${{ env.BUILD_DATE }}
174+
org.opencontainers.image.description=Created from commit ${{ env.GIT_SHA }} and ref ${{ env.GIT_REF }}
175+
org.opencontainers.image.ref.name=${{ env.GIT_REF }}
176+
org.opencontainers.image.revision=${{ github.sha }}
177+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
178+
org.opencontainers.image.version=${{ env.BUILD_VER }}
179+
tags: |
180+
${{ env.DOCKER_IMAGE }}:s6-${{ env.BUILD_BRANCH }}
181+
${{ env.DOCKER_IMAGE }}:s6-${{ env.BUILD_VER }}
182+
ghcr.io/${{ github.repository }}:s6-${{ env.BUILD_BRANCH }}
183+
ghcr.io/${{ github.repository }}:s6-${{ env.BUILD_VER }}
184+
cache-from: type=local,src=/tmp/.buildx-cache
185+
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
186+
187+
- name: Move cache for s6
188+
if: ${{ env.BUILD_BRANCH != env.STABLE_BRANCH }}
116189
run: |
117190
rm -rf /tmp/.buildx-cache
118191
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

.github/workflows/update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
main:
10-
runs-on: ubuntu-22.04
10+
runs-on: large_runner
1111
steps:
1212
- name: Check out repo
1313
id: checkout

3.0/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM golang:alpine AS builder
22

3-
ENV DATAPLANE_MINOR 3.2.4
3+
ENV DATAPLANE_MINOR 3.0.13
44
ENV DATAPLANE_V2_MINOR 2.9.17
55
ENV DATAPLANE_URL https://github.com/haproxytech/dataplaneapi.git
66

@@ -13,7 +13,7 @@ RUN apk add --no-cache ca-certificates git make && \
1313
git checkout "v${DATAPLANE_V2_MINOR}" && \
1414
make build && cp build/dataplaneapi /dataplaneapi-v2
1515

16-
FROM debian:bookworm-slim
16+
FROM debian:trixie-slim
1717

1818
MAINTAINER Dinko Korunic <[email protected]>
1919

3.0/Dockerfile.api

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
FROM debian:trixie-slim
2+
3+
MAINTAINER Dinko Korunic <[email protected]>
4+
5+
LABEL Name HAProxy
6+
LABEL Release Community Edition
7+
LABEL Vendor HAProxy
8+
LABEL Version 3.0.11
9+
LABEL RUN /usr/bin/docker -d IMAGE
10+
11+
ENV HAPROXY_BRANCH 3.0
12+
ENV HAPROXY_MINOR 3.0.11
13+
ENV HAPROXY_SHA256 a133e2d550c5fd9a849b5c7ab17bb945bcdad209ca140d41f45ebf31943ae783
14+
ENV HAPROXY_SRC_URL http://www.haproxy.org/download
15+
16+
ENV HAPROXY_UID haproxy
17+
ENV HAPROXY_GID haproxy
18+
19+
ENV DEBIAN_FRONTEND noninteractive
20+
21+
ENV DATAPLANE_MINOR 3.0.13
22+
ENV DATAPLANE_URL https://github.com/haproxytech/dataplaneapi/releases/download
23+
24+
ARG TARGETPLATFORM
25+
26+
ARG S6_OVERLAY_VERSION=3.2.1.0
27+
ENV S6_OVERLAY_VERSION $S6_OVERLAY_VERSION
28+
ENV S6_READ_ONLY_ROOT=1
29+
ENV S6_USER=haproxy
30+
ENV S6_GROUP=haproxy
31+
32+
COPY /fs /
33+
34+
RUN apt-get update && \
35+
apt-get install -y --no-install-recommends procps libssl3 zlib1g "libpcre2-*" liblua5.4-0 libatomic1 tar xz-utils curl socat ca-certificates libjemalloc2 && \
36+
apt-get install -y --no-install-recommends gcc make libc6-dev libssl-dev libpcre2-dev zlib1g-dev liblua5.4-dev libjemalloc-dev && \
37+
c_rehash && \
38+
curl -sfSL "${HAPROXY_SRC_URL}/${HAPROXY_BRANCH}/src/haproxy-${HAPROXY_MINOR}.tar.gz" -o haproxy.tar.gz && \
39+
echo "$HAPROXY_SHA256 *haproxy.tar.gz" | sha256sum -c - && \
40+
groupadd "$HAPROXY_GID" && \
41+
useradd -g "$HAPROXY_GID" "$HAPROXY_UID" && \
42+
mkdir -p /tmp/haproxy && \
43+
tar -xzf haproxy.tar.gz -C /tmp/haproxy --strip-components=1 && \
44+
rm -f haproxy.tar.gz && \
45+
make -C /tmp/haproxy -j"$(nproc)" TARGET=linux-glibc CPU=generic USE_PCRE2=1 USE_PCRE2_JIT=1 \
46+
USE_TFO=1 USE_LINUX_TPROXY=1 USE_LUA=1 USE_GETADDRINFO=1 \
47+
USE_PROMEX=1 USE_SLZ=1 \
48+
USE_OPENSSL=1 USE_PTHREAD_EMULATION=1 \
49+
USE_QUIC=1 USE_QUIC_OPENSSL_COMPAT=1 \
50+
ADDLIB=-ljemalloc \
51+
all && \
52+
make -C /tmp/haproxy TARGET=linux-glibc install-bin install-man && \
53+
ln -s /usr/local/sbin/haproxy /usr/sbin/haproxy && \
54+
mkdir -p /var/lib/haproxy && \
55+
chown "$HAPROXY_UID:$HAPROXY_GID" /var/lib/haproxy && \
56+
mkdir -p /usr/local/etc/haproxy && \
57+
chown "$HAPROXY_UID:$HAPROXY_GID" /usr/local/etc/haproxy && \
58+
ln -s /usr/local/etc/haproxy /etc/haproxy && \
59+
cp -R /tmp/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors && \
60+
rm -rf /tmp/haproxy && \
61+
case "${TARGETPLATFORM}" in \
62+
"linux/arm64") API_ARCH=arm64 ;; \
63+
"linux/amd64") API_ARCH=x86_64 ;; \
64+
"linux/arm/v6") API_ARCH=arm ;; \
65+
"linux/arm/v7") API_ARCH=arm ;; \
66+
*) echo "ARG TARGETPLATFORM undeclared" >&2 && exit 1 ;; \
67+
esac && \
68+
curl -sfSL "${DATAPLANE_URL}/v${DATAPLANE_MINOR}/dataplaneapi_${DATAPLANE_MINOR}_linux_${API_ARCH}.tar.gz" -o dataplaneapi.tar.gz && \
69+
mkdir -p /tmp/dataplaneapi && \
70+
tar -xzf dataplaneapi.tar.gz -C /tmp/dataplaneapi && \
71+
rm -f dataplaneapi.tar.gz && \
72+
cp /tmp/dataplaneapi/dataplaneapi /usr/local/bin/dataplaneapi && \
73+
chown "$HAPROXY_UID:$HAPROXY_GID" /usr/local/etc/haproxy/dataplaneapi.yml && \
74+
mkdir -p /usr/local/var/lib/dataplaneapi && \
75+
chown "$HAPROXY_UID:$HAPROXY_GID" /usr/local/var/lib/dataplaneapi && \
76+
ln -s /usr/local/var/lib/dataplaneapi /var/lib/dataplaneapi && \
77+
rm -rf /tmp/dataplaneapi && \
78+
case "${TARGETPLATFORM}" in \
79+
"linux/arm64") S6_ARCH=aarch64 ;; \
80+
"linux/amd64") S6_ARCH=x86_64 ;; \
81+
"linux/arm/v6") S6_ARCH=arm ;; \
82+
"linux/arm/v7") S6_ARCH=armhf ;; \
83+
*) echo "ARG TARGETPLATFORM undeclared" >&2 && exit 1 ;; \
84+
esac && \
85+
curl -sS -L -o /tmp/s6-overlay-scripts.tar.xz "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" && \
86+
tar -C / -Jxpf /tmp/s6-overlay-scripts.tar.xz && \
87+
curl -sS -L -o /tmp/s6-overlay-binaries.tar.xz "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz" && \
88+
tar -C / -Jxpf /tmp/s6-overlay-binaries.tar.xz && \
89+
rm -f /tmp/s6-overlay-scripts.tar.xz /tmp/s6-overlay-binaries.tar.xz && \
90+
chown -R "${S6_USER}:${S6_GROUP}" /init /etc/s6-overlay && \
91+
chmod u+x /init /etc/s6-overlay/scripts/* && \
92+
apt-get purge -y --auto-remove gcc make libc6-dev libssl-dev libpcre2-dev zlib1g-dev liblua5.4-dev libjemalloc-dev && \
93+
apt-get clean && \
94+
rm -rf /var/lib/apt/lists/*
95+
96+
EXPOSE 80
97+
EXPOSE 443
98+
EXPOSE 5555
99+
100+
ENTRYPOINT ["/start.sh"]

3.0/fs/etc/s6-overlay/s6-rc.d/dataplaneapi/dependencies.d/base

Whitespace-only changes.

3.0/fs/etc/s6-overlay/s6-rc.d/dataplaneapi/dependencies.d/haproxy

Whitespace-only changes.

3.0/fs/etc/s6-overlay/s6-rc.d/dataplaneapi/dependencies.d/sigusr1

Whitespace-only changes.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/command/with-contenv sh
2+
3+
DP_CONF="/usr/local/etc/haproxy/dataplaneapi.yml"
4+
5+
if grep -q "password: admin" "${DP_CONF}"; then
6+
echo "Generated admin password for Dataplaneapi"
7+
8+
PASS=$(tr -cd 'A-Za-z0-9!?%=' < /dev/urandom | head -c8)
9+
sed -i "s,password: admin,password: ${PASS},g" "${DP_CONF}"
10+
fi
11+
12+
SERVICE_DIRS="/run/s6-rc/servicedirs"
13+
HAP_CONF="/usr/local/etc/haproxy/haproxy.cfg"
14+
15+
if grep -q "user admin insecure-password admin" "${HAP_CONF}"; then
16+
echo "Generated admin password for Dataplaneapi"
17+
18+
PASS=$(tr -cd 'A-Za-z0-9!?%=' < /dev/urandom | head -c8)
19+
sed -i "s,user admin insecure-password admin,user admin insecure-password ${PASS},g" "${HAP_CONF}"
20+
21+
/package/admin/s6/command/s6-svc -2 "${SERVICE_DIRS}/haproxy"
22+
fi
23+
24+
MEMLIMIT=$(free -m | awk '/Mem:/ {printf "%d\n", int($2 / 3)}')
25+
26+
CG_LIMIT_FILE="/sys/fs/cgroup/memory/memory.limit_in_bytes"
27+
if [ -f "/sys/fs/cgroup/cgroup.controllers" ]; then
28+
CG_LIMIT_FILE="/sys/fs/cgroup/memory.max"
29+
fi
30+
31+
if [ -r "${CG_LIMIT_FILE}" ]; then
32+
if grep -q '^max$' "${CG_LIMIT_FILE}"; then
33+
MEMLIMIT_CG="${MEMLIMIT}"
34+
else
35+
MEMLIMIT_CG=$(awk '{printf "%d\n", int($1 / 1024 / 1024 / 3)}' "${CG_LIMIT_FILE}")
36+
fi
37+
38+
if [ "${MEMLIMIT_CG}" -gt 0 ]; then
39+
if [ "${MEMLIMIT_CG}" -lt "${MEMLIMIT}" ]; then
40+
MEMLIMIT="${MEMLIMIT_CG}"
41+
fi
42+
fi
43+
fi
44+
45+
export GOMEMLIMIT="${MEMLIMIT}MiB"
46+
47+
echo "Memory limit for Dataplaneapi: ${GOMEMLIMIT}"
48+
49+
exec /usr/local/bin/dataplaneapi -f=/usr/local/etc/haproxy/dataplaneapi.yml

0 commit comments

Comments
 (0)