Add --rosetta option for arm64 images #846
Merged
+7
−2
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.