feat: add multi-platform OCI image support#548
Open
jasonpaulos wants to merge 2 commits intoanchore:mainfrom
Open
feat: add multi-platform OCI image support#548jasonpaulos wants to merge 2 commits intoanchore:mainfrom
jasonpaulos wants to merge 2 commits intoanchore:mainfrom
Conversation
Signed-off-by: Jason Paulos <jasonpaulos@users.noreply.github.com>
jasonpaulos
commented
Mar 19, 2026
Author
There was a problem hiding this comment.
This file just contains helper functions moved from registry_provider.go
|
|
||
| // NewDirectoryProviderWithPlatform creates a new provider instance for the specific image already at the given path, | ||
| // with the given platform information to use when loading a multiplatform image. | ||
| func NewDirectoryProviderWithPlatform(tmpDirGen *file.TempDirGenerator, path string, platform *image.Platform) image.Provider { |
Author
There was a problem hiding this comment.
I added a new constructor to avoid a potential breaking change on the existing one. Let me know if that's not a concern
|
|
||
| indexManifest, err := index.IndexManifest() | ||
| if err != nil { | ||
| if _, err := index.IndexManifest(); err != nil { |
Author
There was a problem hiding this comment.
I kept this check and layout.FromPath here even though their results aren't used to keep the error messages the same in these failures
Signed-off-by: Jason Paulos <jasonpaulos@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add support to OCI directory image provider for multi-platform OCI images.
Similar to registry images, the user-provided platform is used to select the correct image, unless there is only 1 image available, in which case it will be selected regardless of platform.
Unit and integration tests added to verify functionality.
This fixes #175 and anchore/syft#1545 and addresses part of anchore/syft#1683. To clarify, this doesn't add support for scanning multiple platforms simultaneously, but it does allow stereoscope & syft to operate on a single image within a multi-platform OCI image, which is currently not possible.