Skip to content

Conversation

@rgov
Copy link
Contributor

@rgov rgov commented Nov 4, 2025

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

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 #391.

I considered adding a warning for passing --rosetta when it is not necessary, but there wasn't obvious infrastructure for conveying the message.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

I tested by downloading a statically linked x86 binary and running it inside an arm64 Alpine container created with the new --rosetta flag.

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.

Copy link
Member

@dcantah dcantah left a comment

Choose a reason for hiding this comment

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

This LGTM (and think it's useful), but some other folks may have differing opinions. Will leave open for one other set of eyes

@flukejones
Copy link

Thank you this. It is incredibly helpful for scenarios where I use buildroot and yocto at work.

@dcantah
Copy link
Member

dcantah commented Nov 9, 2025

Going to check this in. We can always revert if we find an issue or anyone has concerns on the ux.

@dcantah dcantah merged commit 651c39c into apple:main Nov 9, 2025
2 checks passed
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.

[Request]: Support Enabling Rosetta on arm64 images

3 participants