fix(docker): add multi-arch (amd64/arm64) Docker build support - #130
Open
MuhammadAbeerAkmal wants to merge 1 commit into
Open
fix(docker): add multi-arch (amd64/arm64) Docker build support#130MuhammadAbeerAkmal wants to merge 1 commit into
MuhammadAbeerAkmal wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds multi-architecture (amd64/arm64) Docker build support so nmrkit can run on arm64 hosts (e.g., Apple Silicon) by removing an amd64-specific JAVA_HOME assumption and enabling multi-platform builds in CI.
Changes:
- Parameterize
JAVA_HOMEin theDockerfileusingTARGETARCHfor per-arch JDK install paths. - Enable QEMU emulation and request
linux/amd64,linux/arm64builds in the dev and prod GitHub Actions workflows.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| Dockerfile | Switches JAVA_HOME to an architecture-dependent path using TARGETARCH. |
| .github/workflows/dev-build.yml | Adds QEMU setup and enables multi-platform builds for the main image. |
| .github/workflows/prod-build.yml | Adds QEMU setup and enables multi-platform builds for the main image. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -1,4 +1,5 @@ | |||
| FROM continuumio/miniconda3:24.1.2-0 AS nmrkit-ms | |||
| ARG TARGETARCH | |||
Comment on lines
104
to
108
| context: . | ||
| file: ./Dockerfile | ||
| push: true | ||
| platforms: linux/amd64,linux/arm64 | ||
| build-args: RELEASE_VERSION=${{ env.RELEASE_TAG }} |
Comment on lines
+34
to
35
| ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-${TARGETARCH}/ | ||
| RUN export JAVA_HOME |
Comment on lines
68
to
72
| context: . | ||
| file: ./Dockerfile | ||
| push: true | ||
| platforms: linux/amd64,linux/arm64 | ||
| build-args: RELEASE_VERSION=${{ env.RELEASE_TAG }} |
Contributor
|
@MuhammadAbeerAkmal Thank you for your pull request. Can you please check the review comments by Copilot and check if they are relevant to be resolved? |
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.
Problem: The
nmrkitDocker image only works on amd64 machines right now. It doesn't run on arm64 machines, like Apple Silicon Mac (M2) etc. houdini69 on #110 ran into this issue and just wantnmrkitto work on his machine.What change in this PR:
Dockerfile:JAVA_HOMEis hardcoded to.../java-17-openjdk-amd64/, which would silently point at a non-existent path when built for arm64 (Debian installs the arm64 JDK under.../java-17-openjdk-arm64/). AddedARG TARGETARCHand switched the path to use it, so it resolves correctly per architecture.dev-build.yml/prod-build.yml: added adocker/setup-qemu-action@v3step (needed so GitHub's amd64 runners can emulate arm64 during the build) andplatforms: linux/amd64,linux/arm64on the mainnmrkitimage build step.Testing: Verified the Dockerfile still builds locally for amd64. Haven't been able to test the arm64 build itself locally which will need to run in CI.
@NishaSharma14: New to this repo! It would be nice if you please review it.