Skip to content

Cross-compile the idle image instead of emulating arm64 - #7

Merged
michaelaguiar merged 1 commit into
mainfrom
idle-image-cross-compile
Oct 14, 2026
Merged

michaelaguiar merged 1 commit into
mainfrom
idle-image-cross-compile

Conversation

@michaelaguiar

Copy link
Copy Markdown
Member

The arm64 leg of release.sh's ingot-idle multi-platform build fails on a machine without QEMU binfmt: the build stage runs on the target platform, so go build hits exec format error.

The stage already cross-compiles with GOOS/GOARCH, so this runs it on $BUILDPLATFORM. Found while cutting v2.0.0, which is blocked on this.

Tested: docker buildx build --platform linux/amd64,linux/arm64 -f Dockerfile.idle . succeeds, and file on each extracted binary shows x86-64 and ARM aarch64.

The build stage ran on each target platform, so the arm64 leg of
release.sh's multi-platform push needed QEMU. Without it (as on the
release machine) go build fails with 'exec format error'. The stage
already cross-compiles via GOOS/GOARCH, so run it on BUILDPLATFORM.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 1 (head 8a2aff2)

A fresh reviewer built both platforms with --no-cache on a machine with no QEMU binfmt. Both legs compiled on amd64, and the outputs are a static x86-64 binary and a static aarch64 binary. Nothing in cmd/ingot-idle or internal/idle uses cgo or build tags. The comments in release.sh, CLAUDE.md and docs/IDLE.md still match the code.

The review found nothing in the diff to fix. It found four P3s; all are declined here, and the first and third are worth a follow-up:

  1. Declined here. scripts/release.sh commits the version bump before it pushes the idle image. If the push fails, the bump commit is left behind and a rerun stops at "nothing to commit". This is real, but it predates this PR and isn't about the Dockerfile. It's worth a follow-up.
  2. Declined. $BUILDPLATFORM needs BuildKit. The only build path is release.sh's docker buildx, and BuildKit has been Docker's default builder since 23.0.
  3. Declined here. There's no .dockerignore, so the whole repo, including a local .env, goes into the build context. Nothing reaches the image, because the Dockerfile copies only go.mod, cmd/ingot-idle and internal/idle. This predates the PR; it's worth a follow-up.
  4. Declined. TARGETVARIANT isn't mapped to GOARM. That only matters if 32-bit ARM is added, and the platform list is amd64 and arm64 only.

@michaelaguiar
michaelaguiar marked this pull request as ready for review October 14, 2026 21:12
@michaelaguiar
michaelaguiar merged commit ffbaa07 into main Oct 14, 2026
@linear-code

linear-code Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
ALI-836 Rename alios-cli to Ingot and ship 2.0.0 with scale to zero

Record of the work finished 2026-10-13 and 2026-10-14. Nothing is left to do here; the follow-ups are linked.

What shipped

Migration on Mike's desktop

  • Moved over: all 13 projects, the CA (already trusted), and the MySQL 8.0 data.
  • Hostnames updated:
    • aguiarshomecrumb MAIL_HOST=ingot_mail
    • alios DB_HOST=ingot_mysql
    • chandlerpediatrics, via ingot env set DB_HOST=ingot_mysql
  • Cleanup: all alios containers, volumes, the network and the binary are removed. ~/.bashrc now has alias php='ingot exec php'.

Verified live

  • 12 projects stopped on schedule.
  • The alios project stayed up because it was getting real traffic.
  • Waking a stopped project takes about 270 ms: michaelaguiar.dev, glowhouse.

Not tested

  • Docker Desktop (macOS/Windows)
  • Rootless Docker

Review in Linear

This was referenced Oct 14, 2026
@michaelaguiar
michaelaguiar deleted the idle-image-cross-compile branch October 14, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant