Build multi-platform image for linux/amd64 and linux/arm64
PR Checks / checks (pull_request) Successful in 34m52s
Build / build-and-push (push) Successful in 32m4s

The builder stage cross-compiles Caddy for the target platform, so no
emulation is needed. The module check runs against the amd64 image; PR
checks also build arm64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #1.
This commit is contained in:
2026-10-08 16:19:14 +01:00
co-authored by Claude Opus 5.5
parent 17fef5e882
commit 3eec79fa44
4 changed files with 30 additions and 8 deletions
+6 -2
View File
@@ -1,8 +1,12 @@
# Caddy with the caddy-dns/desec module, for ACME DNS-01 challenges against
# zones hosted at deSEC. Otherwise the stock caddy:2-alpine image.
FROM caddy:2-builder AS builder
RUN xcaddy build --with github.com/caddy-dns/desec
# The builder runs on the build host and cross-compiles for the target
# platform, so multi-platform builds need no emulation.
FROM --platform=$BUILDPLATFORM caddy:2-builder AS builder
ARG TARGETOS TARGETARCH
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
xcaddy build --with github.com/caddy-dns/desec
FROM caddy:2-alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy