Add --rosetta option for arm64 images#846
Merged
dcantah merged 1 commit intoapple:mainfrom Nov 9, 2025
Merged
Conversation
dcantah
approved these changes
Nov 4, 2025
Member
dcantah
left a comment
There was a problem hiding this comment.
This LGTM (and think it's useful), but some other folks may have differing opinions. Will leave open for one other set of eyes
|
Thank you this. It is incredibly helpful for scenarios where I use buildroot and yocto at work. |
Member
|
Going to check this in. We can always revert if we find an issue or anyone has concerns on the ux. |
saehejkang
pushed a commit
to saehejkang/container
that referenced
this pull request
Jan 27, 2026
`container` automatically enables Rosetta for amd64 containers. This change allows Rosetta to be enabled for arm64 containers by passing the `--rosetta` flag. This allows native containers to benefit from being able to execute the occasional amd64 executable in niche situations, e.g., containers used for cross-compilation. Resolves apple#391. I considered adding a warning for passing `--rosetta` when it is not necessary, but there wasn't obvious infrastructure for conveying the
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.
Type of Change
Motivation and Context
containerautomatically enables Rosetta for amd64 containers. This change allows Rosetta to be enabled for arm64 containers by passing the--rosettaflag. This allows native containers to benefit from being able to execute the occasional amd64 executable in niche situations, e.g., containers used for cross-compilation.Resolves #391.
I considered adding a warning for passing
--rosettawhen it is not necessary, but there wasn't obvious infrastructure for conveying the message.Testing
I tested by downloading a statically linked x86 binary and running it inside an arm64 Alpine container created with the new
--rosettaflag.I attempted to write a test case but I hit this issue with my Swift toolchain. An ideal test case might involve actually executing an amd64 binary within an arm64 container, but I didn't come up with a simple way to do so.