Skip to content

feat(devcontainer): support arm64 architecture - #8862

Merged
timosachsenberg merged 2 commits into
developfrom
fix/devcontainer-arm64
Mar 9, 2026
Merged

timosachsenberg merged 2 commits into
developfrom
fix/devcontainer-arm64

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Mar 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds a minimal Dockerfile that uses Docker BuildKit's TARGETARCH to automatically select the correct base image (latest-amd64 or latest-arm64)
  • Falls back to amd64 when BuildKit is not available (via ARG TARGETARCH=amd64)
  • ARM64/Apple Silicon users can manually override by adding "args": {"TARGETARCH": "arm64"} to the build config in devcontainer.json

Supersedes #8741 — that PR had a non-functional multi-stage archdetect build and unnecessary files. This PR keeps it to a 6-line Dockerfile and a 1-line change to devcontainer.json.

Fixes #8740

Test plan

  • Open devcontainer on x86_64 — should pull latest-amd64 image
  • Open devcontainer on ARM64/Apple Silicon — should auto-detect and pull latest-arm64 image
  • On older Docker without BuildKit — should fall back to latest-amd64
  • Manual override: add "args": {"TARGETARCH": "arm64"} to devcontainer.json build config and verify it pulls latest-arm64

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated development environment container configuration.

Use a Dockerfile with ARG TARGETARCH (set automatically by BuildKit,
default since Docker 23.0) to select the correct base image. Falls back
to amd64 when BuildKit is not available. ARM64 users can override via
build args in devcontainer.json if auto-detection fails.

Fixes #8740

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@jpfeuffer

Copy link
Copy Markdown
Contributor

Please use buildx instead as mentioned in the linked issue

@jpfeuffer

Copy link
Copy Markdown
Contributor

Buildx will put all archs of an image under one image bundle and automatically choose the matching one based on the downstream images you are building.

@jpfeuffer

Copy link
Copy Markdown
Contributor

@coderabbitai

coderabbitai Bot commented Mar 9, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 993607cf-0870-4c6c-9842-0a024e08fead

📥 Commits

Reviewing files that changed from the base of the PR and between efe4b7c and 7717458.

📒 Files selected for processing (1)
  • .devcontainer/devcontainer.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • .devcontainer/devcontainer.json

📝 Walkthrough

Walkthrough

This pull request removes the hardcoded -amd64 architecture suffix from the devcontainer Docker image tag in .devcontainer/devcontainer.json, changing it from latest-amd64 to latest. This enables the devcontainer configuration to support multiple architectures including arm64.

Changes

Cohort / File(s) Summary
Devcontainer Configuration
.devcontainer/devcontainer.json
Removed the hardcoded -amd64 architecture suffix from the Docker image tag to enable platform-agnostic image selection for arm64 and other architectures.

Possibly related PRs

Poem

🐰 A rabbit hops through archs diverse,
No longer bound to one CPU's verse,
The -amd64 suffix takes its flight,
Now arm64 devices work just right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: updating devcontainer configuration to support ARM64 architecture through a multi-arch manifest approach.
Linked Issues check ✅ Passed The PR successfully addresses issue #8740 by updating the image reference from the hardcoded amd64-specific tag to a multi-arch manifest tag that automatically selects the correct architecture.
Out of Scope Changes check ✅ Passed The PR contains only a single, minimal change to devcontainer.json that is directly scoped to addressing ARM64 support as required by issue #8740.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/devcontainer-arm64

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.devcontainer/Dockerfile (1)

5-6: Consider: Running as non-root user (Trivy DS-0002).

The static analysis tool flags that no USER directive specifies a non-root user. For devcontainers this is often intentional (e.g., the postCreateCommand runs yum install which requires root), so this may be acceptable. If you want to suppress the warning or follow the principle of least privilege, you could add a non-root user and switch to it after package installation—though this would require restructuring the install step.

This is a low-priority consideration given the devcontainer context.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.devcontainer/Dockerfile around lines 5 - 6, The Dockerfile currently uses
ARG TARGETARCH and FROM
ghcr.io/openms/contrib_manylinux_2_34:latest-${TARGETARCH} without a USER
directive; add steps to create a non-root user (e.g., addgroup/adduser or use a
dedicated uid/gid), perform package installation and any root-required setup
while still root, then switch to that non-root account using the USER
instruction (ensure any file permissions/ownership are adjusted for that user).
Update the Dockerfile so root-only commands remain before switching and
reference the ARG TARGETARCH/FROM block as the place to add these user creation
and USER switch steps.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.devcontainer/Dockerfile:
- Around line 5-6: The Dockerfile currently uses ARG TARGETARCH and FROM
ghcr.io/openms/contrib_manylinux_2_34:latest-${TARGETARCH} without a USER
directive; add steps to create a non-root user (e.g., addgroup/adduser or use a
dedicated uid/gid), perform package installation and any root-required setup
while still root, then switch to that non-root account using the USER
instruction (ensure any file permissions/ownership are adjusted for that user).
Update the Dockerfile so root-only commands remain before switching and
reference the ARG TARGETARCH/FROM block as the place to add these user creation
and USER switch steps.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eb4d92eb-c6e5-4828-9e14-dc2acd7e5eff

📥 Commits

Reviewing files that changed from the base of the PR and between 661f3fc and efe4b7c.

📒 Files selected for processing (2)
  • .devcontainer/Dockerfile
  • .devcontainer/devcontainer.json

Remove the Dockerfile with ARG TARGETARCH and revert to using the
image directly. The `latest` tag should be a multi-arch manifest
(created via `docker buildx imagetools create`) so Docker automatically
pulls the correct architecture.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@timosachsenberg

Copy link
Copy Markdown
Contributor Author

Updated — removed the Dockerfile with ARG TARGETARCH and switched back to referencing the image directly via "image": "ghcr.io/openms/contrib_manylinux_2_34:latest".

This relies on the latest tag being a multi-arch manifest. It can be created from the existing per-arch images with:

docker buildx imagetools create \
  -t ghcr.io/openms/contrib_manylinux_2_34:latest \
  ghcr.io/openms/contrib_manylinux_2_34:latest-amd64 \
  ghcr.io/openms/contrib_manylinux_2_34:latest-arm64

Currently latest is a single-platform (amd64) image. Once it's updated to a multi-arch manifest, Docker will automatically pull the correct architecture.

@timosachsenberg
timosachsenberg requested a review from poshul March 9, 2026 16:35
@timosachsenberg
timosachsenberg merged commit 5a67093 into develop Mar 9, 2026
19 checks passed
@timosachsenberg
timosachsenberg deleted the fix/devcontainer-arm64 branch March 9, 2026 16:46
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.

Make Devcontainer support arm64

2 participants