fix(docker): add multi-arch (amd64/arm64) Docker build support - #130
fix(docker): add multi-arch (amd64/arm64) Docker build support#130MuhammadAbeerAkmal wants to merge 3 commits 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.
|
@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? |
|
@NishaSharma14 I checked all four Copilot comments and they were relevant. Added a safe default for |
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.