From 4b8e6f793fee6970f41eaacd8435f374f468136a Mon Sep 17 00:00:00 2001 From: jedarden Date: Tue, 26 May 2026 13:26:26 -0400 Subject: [PATCH] fix(docker): pin GOOS/GOARCH to linux/amd64 in go build The multi-arch change (2cd4410) derived GOOS/GOARCH from TARGETPLATFORM with wrong cut field indices (-f2/-f3), yielding the invalid pair amd64/amd64 -> `go: unsupported GOOS/GOARCH pair amd64/amd64`, failing every CI image build since May 24. CI builds amd64 only (ESP-IDF firmware is x86_64-only), so pin linux/amd64 explicitly. Co-Authored-By: Claude Opus 4.7 (1M context) --- Dockerfile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8baf561..54b0879 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,15 +56,14 @@ COPY mothership/ ./ # The go:embed directive in cmd/mothership/main.go references the local dashboard directory COPY dashboard/ ./cmd/mothership/dashboard/ -# Build the binary with cross-platform support +# Build the binary. CI builds amd64 only (ESP-IDF firmware is x86_64-only), +# so GOOS/GOARCH are pinned to linux/amd64. # CGO_ENABLED=0 because we use pure-Go SQLite (modernc.org/sqlite) -# GOOS/GOARCH derived from TARGETPLATFORM for multi-arch builds # -tags=embed enables dashboard embedding via go:embed ARG VERSION=dev ARG TARGETPLATFORM RUN CGO_ENABLED=0 \ - GOOS=$(echo $TARGETPLATFORM | cut -d'/' -f2) \ - GOARCH=$(echo $TARGETPLATFORM | cut -d'/' -f3) \ + GOOS=linux GOARCH=amd64 \ go build \ -ldflags="-s -w -X main.version=${VERSION}" \ -tags=embed \ @@ -73,8 +72,7 @@ RUN CGO_ENABLED=0 \ # Also build the CSI simulator so the same image can run synthetic-node load # against a deployed mothership (used by the in-cluster simulator workload). RUN CGO_ENABLED=0 \ - GOOS=$(echo $TARGETPLATFORM | cut -d'/' -f2) \ - GOARCH=$(echo $TARGETPLATFORM | cut -d'/' -f3) \ + GOOS=linux GOARCH=amd64 \ go build \ -ldflags="-s -w" \ -o spaxel-sim ./cmd/sim