-
Notifications
You must be signed in to change notification settings - Fork 6
Feat: Allows multi platform builds for both linux/amd64 & linux/arm64
#64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enables multi-platform Docker image builds to support both linux/amd64 and linux/arm64 architectures, addressing the issue where Mac users with M-series chips cannot pull the image due to missing ARM64 manifests.
Key Changes:
- Removed CPU-specific optimization flags (
-march=native) from the Dockerfile build process to enable cross-platform compilation - Updated GitHub Actions workflow to build and push images for both AMD64 and ARM64 platforms
- Modified tagging strategy to push
latesttag for official version releases
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| Dockerfile | Removed -march=native optimization flags and CGO_ENABLED=1 to support cross-platform builds; added commented-out build configuration |
| .github/workflows/docker-build-publish.yaml | Updated platform targets to include ARM64, modified tagging logic for latest, and changed push/load behavior to always push images |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…mic environment variable setting.
…and remove nightly tag push for PRs in Docker build workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Signed-off-by: Aaron Jeongwoo Kim <[email protected]>
… intermediate step before creating multi-arch manifests.
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Issue
#66
What's done?
This PR implements a Parallel Native Build Strategy to support multi-architecture Docker images (
linux/amd64andlinux/arm64). It utilizes concurrent jobs to improve build performance, as illustrated in the diagram below:How to test the changes
Tip
You can check your machine's CPU architecture with the following command:
uname -mNote
Please note that a temporary image tag
-pr64has been deployed solely for testing purposes. This will not occur in future PRs as the test configuration has been removedTry to pull image from your Mac with M Chips without multi architecture
Then do the following:
Other strategies considered
Click to view details
Use flag--platformI initially considered using the
--platform=linux/amd64,linux/arm64flag but this approach took significantly longer (approx. 13 minutes) due to the overhead of emulation when building for non-native architectures, as shown below:Use single registry for both temporary image and official imageWe considered pushing intermediate images with
-arm64or-amd64suffixes to the main registry as following, but to keep the main registry clean, we decided to use ghcr.io as a temporary staging registry instead:Other minor changes
DOCKER_REGISTRY_URLandDOCKER_REGISTRY_IMAGEas static values, as dynamic assignment is unnecessaryThings to note
Reference
Registry: