From a33a73bc9ee98f1a41768b1fe241f159177cf097 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Mon, 2 Feb 2026 21:53:38 +0300 Subject: [PATCH 1/2] fix: Use TARGETARCH for multi-platform builds Replace hardcoded GOARCH=amd64 with TARGETARCH which is automatically set by Docker buildx during multi-platform builds. This enables building kilo images for arm64 and other architectures. The GOARCH variable now defaults to TARGETARCH when set, falling back to amd64 for backward compatibility with non-buildx builds. Co-Authored-By: Claude Signed-off-by: Aleksei Sviridkin --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 028c9d29..33427437 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ ARG FROM=alpine FROM $FROM AS cni -ARG GOARCH=amd64 +# TARGETARCH is automatically set by Docker buildx for multi-platform builds +ARG TARGETARCH +ARG GOARCH=${TARGETARCH:-amd64} ARG CNI_PLUGINS_VERSION=v1.1.1 RUN apk add --no-cache curl && \ curl -Lo cni.tar.gz https://github.com/containernetworking/plugins/releases/download/$CNI_PLUGINS_VERSION/cni-plugins-linux-$GOARCH-$CNI_PLUGINS_VERSION.tgz && \ From 71eea82214aae1ac1d5224a0f167602035e441d5 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Wed, 11 Feb 2026 00:34:30 +0300 Subject: [PATCH 2/2] fix: Use TARGETARCH in runtime stage for multi-platform builds The runtime stage also references GOARCH for copying pre-built binaries (bin/linux/$GOARCH/kg). Without TARGETARCH, buildx leaves GOARCH empty, breaking the COPY paths. Co-Authored-By: Claude Signed-off-by: Aleksei Sviridkin --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 33427437..728a9729 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,8 @@ RUN apk add --no-cache curl && \ tar -xf cni.tar.gz FROM $FROM -ARG GOARCH +ARG TARGETARCH +ARG GOARCH=${TARGETARCH:-amd64} ARG ALPINE_VERSION=v3.20 LABEL maintainer="squat " RUN echo -e "https://alpine.global.ssl.fastly.net/alpine/$ALPINE_VERSION/main\nhttps://alpine.global.ssl.fastly.net/alpine/$ALPINE_VERSION/community" > /etc/apk/repositories && \