fix: Pin Alpine to 3.19 and split apk commands for QEMU ARM64 compatibility
All checks were successful
CI/CD / Test (push) Successful in 28s
CI/CD / Lint (push) Successful in 38s
CI/CD / Generate SBOM (push) Successful in 16s
CI/CD / Build (darwin-amd64) (push) Successful in 21s
CI/CD / Build (linux-amd64) (push) Successful in 20s
CI/CD / Build (darwin-arm64) (push) Successful in 20s
CI/CD / Build (linux-arm64) (push) Successful in 21s
CI/CD / Build & Push Docker Image (push) Successful in 24s
CI/CD / Release (push) Has been skipped

- 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
This commit is contained in:
2025-12-13 09:45:07 +00:00
parent e0b8acf858
commit 48c43b2d2e

View File

@@ -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