From 58d933148abd37c1f89bede9788798d65d590531 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Mon, 2 Feb 2026 21:53:42 +0300 Subject: [PATCH] fix(piraeus-server): Use TARGETARCH for losetup-container download Replace $(uname -m) with TARGETARCH for downloading losetup-container binary. The previous approach used the build host architecture instead of the target architecture, which breaks cross-compilation builds (e.g., building arm64 images on amd64 hosts). The fix maps TARGETARCH values (amd64, arm64) to the corresponding uname -m format (x86_64, aarch64) expected by losetup-container releases. Co-Authored-By: Claude Signed-off-by: Aleksei Sviridkin --- dockerfiles/piraeus-server/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dockerfiles/piraeus-server/Dockerfile b/dockerfiles/piraeus-server/Dockerfile index ae1cd63..b1c55f4 100644 --- a/dockerfiles/piraeus-server/Dockerfile +++ b/dockerfiles/piraeus-server/Dockerfile @@ -69,7 +69,9 @@ ARG TARGETARCH RUN wget https://github.com/LINBIT/k8s-await-election/releases/download/${K8S_AWAIT_ELECTION_VERSION}/k8s-await-election-${K8S_AWAIT_ELECTION_VERSION}-linux-${TARGETARCH}.tar.gz -O - | tar -xvz -C /usr/bin/ ARG LOSETUP_CONTAINER_VERSION=v1.0.1 -RUN wget "https://github.com/LINBIT/losetup-container/releases/download/${LOSETUP_CONTAINER_VERSION}/losetup-container-$(uname -m)-unknown-linux-gnu.tar.gz" -O - | tar -xvz -C /usr/local/sbin && \ +# Map TARGETARCH to uname -m format for losetup-container download +RUN ARCH=$(case ${TARGETARCH} in amd64) echo x86_64;; arm64) echo aarch64;; *) echo ${TARGETARCH};; esac) && \ + wget "https://github.com/LINBIT/losetup-container/releases/download/${LOSETUP_CONTAINER_VERSION}/losetup-container-${ARCH}-unknown-linux-gnu.tar.gz" -O - | tar -xvz -C /usr/local/sbin && \ printf '#!/bin/sh\nLOSETUP_CONTAINER_ORIGINAL_LOSETUP=%s exec /usr/local/sbin/losetup-container "$@"\n' $(command -v losetup) > /usr/local/sbin/losetup && \ chmod +x /usr/local/sbin/losetup