From 7eb6b4b2f7c00526b980c8c622d866a75a0442d1 Mon Sep 17 00:00:00 2001 From: Chris Novakovic Date: Tue, 2 Dec 2025 20:04:57 +0000 Subject: [PATCH] Don't specify a platform for the parent image `--platform=$BUILDPLATFORM` forces the parent image to have the same platform as the native platform on which the image is built, which in this case is linux/amd64 (because the image is built on GitHub's `ubuntu-24.04` runner image). The "linux/arm64" variant of the image is therefore just Alpine Linux x86-64, which silently works - at least, until you try to run an arm64 binary inside the container - as long as the host has QEMU installed, because it is able to (potentially very slowly) emulate the x86-64 instruction set for the container. Don't force a specific platform in the Containerfile, and trust Docker to choose a platform-appropriate parent image at build time (which it does). --- alpine-builder.Containerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpine-builder.Containerfile b/alpine-builder.Containerfile index 8b88d8d..fd3435b 100644 --- a/alpine-builder.Containerfile +++ b/alpine-builder.Containerfile @@ -1,5 +1,5 @@ # alpine:3.22.2 -FROM --platform=$BUILDPLATFORM alpine@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412 +FROM alpine@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412 USER root