feat(ci): build multi-arch Docker image (linux/amd64 + linux/arm64)#137
Merged
feat(ci): build multi-arch Docker image (linux/amd64 + linux/arm64)#137
Conversation
Adds QEMU setup and the `platforms: linux/amd64,linux/arm64` arg to the build-push-action. Apple Silicon Macs and arm64 Linux hosts get a native image (pulled automatically via manifest selection) instead of running under QEMU emulation. amd64 users are unaffected. Tradeoff: arm64 is cross-compiled via QEMU on the x86_64 runner, so release builds are noticeably longer (the torch install + model bake stage both run emulated). Acceptable at current release cadence; can upgrade to a native arm64 runner matrix if it becomes painful.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #135 and #136.
Summary
platforms: linux/amd64,linux/arm64to thepublish-dockerjob. Apple Silicon Macs and arm64 Linux hosts (e.g. AWS Graviton) now get a native image through manifest selection, instead of running the amd64 image under Docker Desktop's emulation — which is especially slow for this image because oftorch+ sentence-transformers at runtime.Tradeoff
arm64 is cross-compiled via QEMU on the x86_64 runner, so release builds take noticeably longer (the torch install in stage 1 and the model bake in stage 2 both run emulated). Acceptable for our release cadence; if it becomes painful we can split into an amd64/arm64 matrix using GitHub's native
ubuntu-24.04-armrunner +docker/metadata-actionmanifest merge.Test plan
workflow_dispatchwithtest_docker=true) after this lands to verify both platforms build successfully. The:testtag gets a multi-arch manifest;docker buildx imagetools inspect cocoindex/cocoindex-code:testshould show both platforms.🤖 Generated with Claude Code