mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
fix(container): cross-compile per target platform so linux/arm64 ships an arm64 binary (#382)
The build stage ran natively on $BUILDPLATFORM and make never received a target arch, so both manifest variants shipped the same amd64 binary (#379). Pass TARGETOS/TARGETARCH into the build with CGO_ENABLED=0 and verify each platform variant runs 'pmg version' after push. Fixes #379 Claude-Session: https://claude.ai/code/session_01E8yrxjqVw7454zByb8kxvD Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -67,4 +67,10 @@ jobs:
|
||||
.
|
||||
fi
|
||||
|
||||
- name: Verify Image Platform Variants
|
||||
run: |
|
||||
for platform in linux/amd64 linux/arm64; do
|
||||
docker run --rm --platform $platform $REGISTRY/$IMAGE_NAME:latest version
|
||||
done
|
||||
|
||||
|
||||
|
||||
+3
-1
@@ -9,7 +9,9 @@ RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN make
|
||||
ARG TARGETOS TARGETARCH
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} make
|
||||
|
||||
FROM debian:11-slim@sha256:e4b93db6aad977a95aa103917f3de8a2b16ead91cf255c3ccdb300c5d20f3015
|
||||
# Original: debian:11-slim
|
||||
|
||||
Reference in New Issue
Block a user