From 4a2de8f8a47bc8acf9c3c608c3300a46fbc3ea84 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Jul 2026 12:53:47 +0000 Subject: [PATCH] Fix Docker COPY paths for goreleaser dockers_v2 platform layout --- Makefile | 1 + package/Dockerfile.k3k | 14 ++++++++++---- package/Dockerfile.k3k-kubelet | 10 ++++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e9107124..c1b06b67 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,7 @@ package: package-k3k package-k3k-kubelet ## Package the k3k and k3k-kubelet Dock .PHONY: package-% package-%: docker build -f package/Dockerfile.$* \ + --build-arg BIN_DIR=bin \ -t $(REPO)/$*:$(VERSION) \ -t $(REPO)/$*:latest \ -t $(REPO)/$*:dev . diff --git a/package/Dockerfile.k3k b/package/Dockerfile.k3k index f946c1c2..077ecb0e 100644 --- a/package/Dockerfile.k3k +++ b/package/Dockerfile.k3k @@ -1,9 +1,15 @@ FROM registry.suse.com/bci/bci-base:16.1 -ARG BIN_K3K=bin/k3k -ARG BIN_K3KCLI=bin/k3kcli +ARG TARGETPLATFORM +# BIN_DIR is the directory containing the binaries within the build context. +# GoReleaser (dockers_v2) stages binaries under a per-platform directory that +# matches TARGETPLATFORM (e.g. linux/amd64), so that is the default. Other +# callers (e.g. the Makefile) can override it, for example with BIN_DIR=bin. +ARG BIN_DIR=${TARGETPLATFORM} +ARG BIN_K3K=k3k +ARG BIN_K3KCLI=k3kcli -COPY ${BIN_K3K} /usr/bin/ -COPY ${BIN_K3KCLI} /usr/bin/ +COPY ${BIN_DIR}/${BIN_K3K} /usr/bin/ +COPY ${BIN_DIR}/${BIN_K3KCLI} /usr/bin/ CMD ["k3k"] diff --git a/package/Dockerfile.k3k-kubelet b/package/Dockerfile.k3k-kubelet index e237714d..606bb02b 100644 --- a/package/Dockerfile.k3k-kubelet +++ b/package/Dockerfile.k3k-kubelet @@ -1,8 +1,14 @@ # TODO: swicth this to BCI-micro or scratch. Left as base right now so that debug can be done a bit easier FROM registry.suse.com/bci/bci-base:16.1 -ARG BIN_K3K_KUBELET=bin/k3k-kubelet +ARG TARGETPLATFORM +# BIN_DIR is the directory containing the binaries within the build context. +# GoReleaser (dockers_v2) stages binaries under a per-platform directory that +# matches TARGETPLATFORM (e.g. linux/amd64), so that is the default. Other +# callers (e.g. the Makefile) can override it, for example with BIN_DIR=bin. +ARG BIN_DIR=${TARGETPLATFORM} +ARG BIN_K3K_KUBELET=k3k-kubelet -COPY ${BIN_K3K_KUBELET} /usr/bin/ +COPY ${BIN_DIR}/${BIN_K3K_KUBELET} /usr/bin/ ENTRYPOINT ["/usr/bin/k3k-kubelet"]