93096ea5b6
Go HTTP server with five handlers:
GET / -> 200 {env, status, soul}
GET /health -> 200 {ok:true}
POST /api/share -> 410 not_available_in_sandbox
GET /said -> 410 not_available_in_sandbox
GET /share/* -> 410 not_available_in_sandbox
any other -> 404 not_found
Distroless final image. Cross-compiled on host (Apple Silicon QEMU + Go
crashes with lfstack.push when go build runs inside an emulated linux/amd64
container). Pushed to us-central1-docker.pkg.dev/neuron-785695/neuron-sandbox/sandbox:initial.
Replaced when the real soul build pipeline lands.
22 lines
641 B
Bash
Executable File
22 lines
641 B
Bash
Executable File
#!/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"
|