netanalyzer/docker
Joseph McQueen 74b3a9fcb6 fix(docker): actually cross-build linux/amd64 image on Apple Silicon
The default buildx builder (docker driver) is bound to the daemon's native
platform, so on an Apple Silicon Mac `--platform linux/amd64 --load` was
silently producing an arm64 image. The bundle then failed on the linux/amd64
target host with the "exec format error" that install.sh's arch sanity
check now surfaces as "Image architecture (arm64) does not match this host
(amd64)".

package.sh now:
- Creates a dedicated `sha-remote-agent-builder` (docker-container driver)
  on first run so cross-arch builds actually work.
- Best-effort installs tonistiigi/binfmt QEMU handlers when the target
  platform differs from the host.
- Uses `--output type=docker,dest=...` instead of `--load` + `docker save`,
  bypassing the local daemon's cross-arch storage limits entirely.
- Verifies the produced image's Architecture against --platform after the
  build and aborts if they disagree, so a broken ZIP can never leave the
  build host.
- Only re-tags :latest when the built platform matches the host, to avoid
  leaving a broken cross-arch :latest in the local daemon.

README documents the trap and the mitigations.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 10:02:43 -04:00
..
remote-agent fix(docker): actually cross-build linux/amd64 image on Apple Silicon 2026-07-06 10:02:43 -04:00