From 48c43b2d2ec768b81a5054f65f1b7a3aff58bd7c Mon Sep 17 00:00:00 2001 From: renz Date: Sat, 13 Dec 2025 09:45:07 +0000 Subject: [PATCH] fix: Pin Alpine to 3.19 and split apk commands for QEMU ARM64 compatibility - Removed redundant --platform=$TARGETPLATFORM from runtime stage - Pinned Alpine to 3.19 for better QEMU emulation stability - Split apk add commands to prevent trigger failures under QEMU - Fixes ARM64 build failures in CI/CD pipeline --- Dockerfile.multiarch | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Dockerfile.multiarch b/Dockerfile.multiarch index f14e5ce..f8090c8 100644 --- a/Dockerfile.multiarch +++ b/Dockerfile.multiarch @@ -27,14 +27,18 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \ -o hmac-file-server ./cmd/server/ # Production stage - Multi-arch Alpine -FROM --platform=$TARGETPLATFORM alpine:latest +# Using pinned version 3.19 which has better QEMU compatibility +FROM alpine:3.19 + +# Build arguments for runtime stage +ARG TARGETARCH # Install runtime dependencies -RUN apk add --no-cache \ - ca-certificates \ - tzdata \ - curl \ - shadow +# Split into separate commands for better QEMU compatibility +RUN apk add --no-cache ca-certificates +RUN apk add --no-cache tzdata +RUN apk add --no-cache curl +RUN apk add --no-cache shadow # Create non-root user for security RUN adduser -D -s /bin/sh -u 1011 appuser