-
Notifications
You must be signed in to change notification settings - Fork 508
fix: Pull platform-specific container images by default #455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Change ImagePull CLI to default to Platform.current when no --platform specified - Reduces downloads from ~8GB to ~350MB for multi-arch images - Maintains backward compatibility with explicit --platform flag - Add test to verify default platform behavior
- Use busybox instead of alpine to avoid cache conflicts with other tests - Test now properly verifies single-platform pulling behavior
|
cc @adityaramani as this behavior was chosen for a reason |
|
The reason for pulling (and pushing) all platforms by default is that - if a user decided to do something like the following, and foo is a multi platform image We should be keeping the sha of the index the same for the image we are pushing out, which would mean that we have to push out all the layers / sub-layers referenced in the index, which would include all the platforms. And to do that, we need to have all the layers present on disk That being said - we have quite a few issues around the same area, and are open to changing the default behavior to work with only the current platform. The changes required for this would be
Im not sure if we should have a different default for pull (current platform only) vs push (all platforms), but if we do we'd need some error handling and think about the UX |
@adityaramani I admit I like the sound of a 'smart' push workflow that cares about the local image state (i.e. push all platforms if local image has multiple platforms) but I feel it would introduce too much ambiguity. I would lean toward a coherent workflow for both push/pull such as:
Lastly, this would mean that we're updating the default behavior for push/pull. We'd need to consider how we'll communicate the change to anyone who's currently using this tool... I'd be keen to hear some feedback from others. |
|
Another option might be to allow people to opt in (or out) of the new behaviour using something like defaults write com.apple.container.defaults push.platforms <platforms>
defaults write com.apple.container.defaults pull.platforms <platforms> |
This change addresses issue #83 by modifying the default behavior of
container images pullto automatically select the current platform when no--platformflag is specified.This reduces bandwidth consumption by up to ~95% (from ~8GB to ~350MB for multi-platform images like
python).What changed
ImagePull.swiftto default toPlatform.currentinstead of pulling all platformstestPullDefaultPlatform()--platformflagWhy this change
Users reported excessive bandwidth usage when pulling container images, as the default behavior downloads all available platforms. This particularly impacts users on limited connections and increases registry load unnecessarily.
Testing
--platformflagImpact