From d0398a97a45622064ed1c4af43db4116e0be7c5a Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Sun, 17 May 2026 03:07:37 +0000 Subject: [PATCH 1/2] fix: use native platform for builder stage to avoid QEMU arm64 failures The builder stage only needs to download azcopy binaries and the Microsoft apt repo deb. Running apt install under QEMU emulation for arm64 intermittently fails with 'Exec format error' when binfmt registration is unstable in CI Docker-in-Docker environments. By using --platform=$BUILDPLATFORM, the builder always runs natively (amd64) and downloads the correct arch-specific azcopy binary via TARGETARCH, eliminating the QEMU dependency for this stage. --- pkg/azurefileplugin/Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/azurefileplugin/Dockerfile b/pkg/azurefileplugin/Dockerfile index 09038e1cd3..f4189c9af3 100644 --- a/pkg/azurefileplugin/Dockerfile +++ b/pkg/azurefileplugin/Dockerfile @@ -13,17 +13,19 @@ # limitations under the License. ARG ARCH=amd64 +ARG BUILDPLATFORM +ARG BASE_IMAGE=registry.k8s.io/build-image/debian-base:bookworm-v1.0.7 -FROM registry.k8s.io/build-image/debian-base:bookworm-v1.0.7 AS base +FROM ${BASE_IMAGE} AS base -FROM base AS builder +FROM --platform=$BUILDPLATFORM ${BASE_IMAGE} AS builder -ARG ARCH +ARG TARGETARCH RUN apt update \ && apt install -y curl \ && curl -Lso /tmp/packages-microsoft-prod-22.04.deb https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb \ - && curl -Ls https://github.com/Azure/azure-storage-azcopy/releases/download/v10.32.4/azcopy_linux_${ARCH}_10.32.4.tar.gz \ + && curl -Ls https://github.com/Azure/azure-storage-azcopy/releases/download/v10.32.4/azcopy_linux_${TARGETARCH}_10.32.4.tar.gz \ | tar xvzf - --strip-components=1 -C /usr/local/bin/ --wildcards "*/azcopy" FROM base From 8a0170598fc7daed0f26a622573c3dc9f8ff951f Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Sun, 17 May 2026 07:44:32 +0000 Subject: [PATCH 2/2] fix: add default value for TARGETARCH ARG Give TARGETARCH a default of 'amd64' so the azcopy download URL is always valid even when not running under BuildKit/buildx. --- pkg/azurefileplugin/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/azurefileplugin/Dockerfile b/pkg/azurefileplugin/Dockerfile index f4189c9af3..a3436154f6 100644 --- a/pkg/azurefileplugin/Dockerfile +++ b/pkg/azurefileplugin/Dockerfile @@ -13,14 +13,14 @@ # limitations under the License. ARG ARCH=amd64 -ARG BUILDPLATFORM +ARG BUILDPLATFORM=linux/amd64 ARG BASE_IMAGE=registry.k8s.io/build-image/debian-base:bookworm-v1.0.7 FROM ${BASE_IMAGE} AS base FROM --platform=$BUILDPLATFORM ${BASE_IMAGE} AS builder -ARG TARGETARCH +ARG TARGETARCH=amd64 RUN apt update \ && apt install -y curl \