Repository navigation
feat(devcontainer): support arm64 architecture - #8862
Conversation
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]>
|
Please use buildx instead as mentioned in the linked issue |
|
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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis pull request removes the hardcoded Changes
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.devcontainer/Dockerfile (1)
5-6: Consider: Running as non-root user (Trivy DS-0002).The static analysis tool flags that no
USERdirective specifies a non-root user. For devcontainers this is often intentional (e.g., thepostCreateCommandrunsyum installwhich 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
📒 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]>
|
Updated — removed the This relies on the 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-arm64Currently |
Summary
TARGETARCHto automatically select the correct base image (latest-amd64orlatest-arm64)amd64when BuildKit is not available (viaARG TARGETARCH=amd64)"args": {"TARGETARCH": "arm64"}to the build config indevcontainer.jsonSupersedes #8741 — that PR had a non-functional multi-stage
archdetectbuild and unnecessary files. This PR keeps it to a 6-line Dockerfile and a 1-line change todevcontainer.json.Fixes #8740
Test plan
latest-amd64imagelatest-arm64imagelatest-amd64"args": {"TARGETARCH": "arm64"}to devcontainer.json build config and verify it pullslatest-arm64🤖 Generated with Claude Code
Summary by CodeRabbit