Skip to content

fix(docker): add multi-arch (amd64/arm64) Docker build support - #130

Open
MuhammadAbeerAkmal wants to merge 1 commit into
NFDI4Chem:developmentfrom
MuhammadAbeerAkmal:arm-build-support
Open

fix(docker): add multi-arch (amd64/arm64) Docker build support#130
MuhammadAbeerAkmal wants to merge 1 commit into
NFDI4Chem:developmentfrom
MuhammadAbeerAkmal:arm-build-support

Conversation

@MuhammadAbeerAkmal

Copy link
Copy Markdown

Problem: The nmrkit Docker 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 want nmrkit to work on his machine.

What change in this PR:

  • Dockerfile: JAVA_HOME is 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/). Added ARG TARGETARCH and switched the path to use it, so it resolves correctly per architecture.
  • dev-build.yml / prod-build.yml: added a docker/setup-qemu-action@v3 step (needed so GitHub's amd64 runners can emulate arm64 during the build) and platforms: linux/amd64,linux/arm64 on the main nmrkit image 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.

@MuhammadAbeerAkmal
MuhammadAbeerAkmal changed the base branch from main to development July 30, 2026 17:11
@NishaSharma14
NishaSharma14 requested a lite review from Copilot August 13, 2026 10:50
@NishaSharma14
NishaSharma14 self-requested a review August 13, 2026 10:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_HOME in the Dockerfile using TARGETARCH for per-arch JDK install paths.
  • Enable QEMU emulation and request linux/amd64,linux/arm64 builds 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.

Comment thread Dockerfile
@@ -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 thread Dockerfile
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 }}
@NishaSharma14

Copy link
Copy Markdown
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?

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.

3 participants