#!/usr/bin/env bash # Cross-compile and push the sandbox stub image. # Builds the Go binary natively on the host (amd64 cross-target) to avoid # the QEMU/Rosetta lfstack.push panic when `go build` runs inside an # emulated linux/amd64 container. set -euo pipefail cd "$(dirname "$0")" mkdir -p build echo ">> cross-compile linux/amd64" GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \ go build -trimpath -ldflags="-s -w" -o build/sandbox-stub-linux-amd64 ./... echo ">> docker build + push" docker buildx build --platform linux/amd64 \ -t us-central1-docker.pkg.dev/neuron-785695/neuron-sandbox/sandbox:initial \ --push . echo ">> done"