Support copying multiple platforms. #1939
Open
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.
crane index filter
is a great way to copy multi-platform images without copying undesired platforms. Unfortunately, that command requires that the source image support multiple platforms (i.e., has a manifest list/index). In a scenario where you may be programmatically copying images, some source images may not host a manifest list/index, and additional checks must be performed to decide betweencrane index filter
andcrane copy
.This PR updates
crane copy
so that it behaves similar tocrane index filter
, but does not require a manifest list/index. In a single-platform scenario, it behaves much as it did before. In a multi-platform scenario, it filters the manifest list/index to the desired platforms, and copies only those layers.Example command: