Skip to content

Conversation

@stevapple
Copy link
Contributor

@stevapple stevapple commented Jul 26, 2025

This PR:

I do have a question on how utils.BuildPlatforms() is implemented and why we didn't just use platforms.DefaultSpec(). However, this can be left to future discussions and we can maintain the current behavior.

@egernst egernst requested a review from katiewasnothere July 28, 2025 16:32
Comment on lines 136 to 137
bp := utils.BuildPlatforms()

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix @stevapple! I do think we can just use DefaultSpec here unless @wlan0 has any concerns with that.

Copy link
Contributor Author

@stevapple stevapple Jul 29, 2025

Choose a reason for hiding this comment

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

After investigating the implementation of utils.BuildPlatforms, it looks like container wanted to support a list of build platforms with the help of Rosetta. That means linux/amd64 will be an acceptable (but not default) build platform even when running on an Apple Silicon host. In practice, even BuildKit doesn't quite support such use case though.

In case of blocking future implementation of multi build platform support, I would suggest turning the property into a list, as in 3492640.

@wlan0
Copy link
Contributor

wlan0 commented Jul 29, 2025

PR looks good to me overall, except a few nits. I would also like to see a small section added to the docs explaining how this PR enables new cross platform patterns.

There needs to be unit tests for this PR. As of now, no unit tests exist for frontend, so this is a good opportunity to start adding tests.

@wlan0
Copy link
Contributor

wlan0 commented Jul 29, 2025

Thanks for adding tests. LGTM

@wlan0 wlan0 merged commit 0d9ee14 into apple:main Jul 29, 2025
2 checks passed
@stevapple stevapple deleted the global-args branch July 30, 2025 16:22
@stevapple
Copy link
Contributor Author

@wlan0 Could you tag a new version with this patch so that we can include it in the upcoming monthly release?

@stevapple
Copy link
Contributor Author

Ping again @wlan0 , would you mind tagging a new version?

@katiewasnothere
Copy link
Contributor

@stevapple Made a new tag and opened a PR on container to take the new tag apple/container#605

katiewasnothere added a commit to apple/container that referenced this pull request Sep 12, 2025
…605)

## Type of Change
- [x] Dependency update

## Motivation and Context
A change was made in container-builder-shim to support BuildKit's
default global args
apple/container-builder-shim#44. A new tag of
container-builder-shim was made with this change and this PR updates to
that new tag for container-builder-shim.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
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.

[Bug]: container do support cross-platform build, but may fail with --platform specified in Dockerfile

3 participants