Fix Docker x64 runner architecture mismatch on ARM hosts#19
Merged
Conversation
Ensure requested Docker runner architecture is actually used by validating pulled/tagged image architecture and forcing container platform during create. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR hardens Docker runner provisioning on ARM hosts by explicitly enforcing image architecture correctness and ensuring containers are created using the requested Docker platform, preventing x64/arm64 mismatch failures.
Changes:
- Add architecture alias normalization and a reusable architecture mismatch assertion for Docker images.
- Verify image architecture both after pulling the base image and after retagging to an architecture-specific tag.
- Force
dockerode.createContainerto target the requestedlinux/amd64orlinux/arm64platform, and add unit tests for the new helpers.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| backend/src/services/dockerRunner.ts | Introduces architecture normalization/assertion helpers, enforces image-arch checks after pull/tag, and sets container creation platform. |
| backend/tests/dockerRunner.test.ts | Adds Vitest coverage for architecture alias normalization and mismatch error behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
linux/amd64orlinux/arm64)Validation
npm run typecheck -w backendnpm run test -w backend -- tests/dockerRunner.test.tsPORT=40123 npm run test -w backendNote
Medium Risk
Changes affect runner provisioning and Docker image selection; failures will now surface earlier as hard errors if images/platforms don’t match, which could impact deployments with custom images/tags.
Overview
Fixes Docker-based GitHub Actions runners on mixed-arch hosts by normalizing and enforcing image architecture during
pullRunnerImage, failing fast if the pulled or retagged image doesn’t match the requestedamd64/arm64.Forces container creation to use the requested
linux/<arch>platform (viacreateContainer({ platform })) to avoid accidental host-arch execution. Adds Vitest coverage for architecture normalization and mismatch errors.Written by Cursor Bugbot for commit 1959e3e. This will update automatically on new commits. Configure here.