sketch: add multi-architecture binary support
Build both amd64 and arm64 Linux binaries and embed them both.
Simplify API to use single LinuxBinary(arch) function for architecture
selection. Update copyEmbeddedLinuxBinaryToContainer to detect Docker
server architecture using 'docker version --format' and automatically
use the correct binary.
This enables sketch to work correctly on both x86_64 and ARM64
Docker environments without requiring architecture-specific builds.
Unsupported architectures return nil instead of panicking.
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: sd498605bf58e984ek
diff --git a/Makefile b/Makefile
index 2b31b66..69192e6 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,8 @@
go build -ldflags="$(LDFLAGS)" -tags=outie -o sketch ./cmd/sketch
innie: webui-assets
- CGO_ENABLED=0 GOOS=linux go build -ldflags="$(LDFLAGS)" -tags=innie -o embedded/sketch-linux/sketch-linux ./cmd/sketch
+ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$(LDFLAGS)" -tags=innie -o embedded/sketch-linux/sketch-linux-amd64 ./cmd/sketch
+ CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$(LDFLAGS)" -tags=innie -o embedded/sketch-linux/sketch-linux-arm64 ./cmd/sketch
webui-assets:
rm -rf embedded/webui-dist