fix: Support OCI and compressed layer extraction#693
Open
Vortelf wants to merge 1 commit intowagoodman:mainfrom
Open
fix: Support OCI and compressed layer extraction#693Vortelf wants to merge 1 commit intowagoodman:mainfrom
Vortelf wants to merge 1 commit intowagoodman:mainfrom
Conversation
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.
Fixes #687
Problem
Extractfunction was failing to extract files from Docker image layers for OCI-format images (the default since Docker 25+)Root Causes
dive/image/docker/layer.gousedstrings.Split(tree.Name, "/")[0]to derive the layer ID which only works for Docker images and therefor it was always failing to retrieve the layer for OCI images.ExtractFromImagesearched for entries named<layer-id>/layer.tarand OCI images store layers asblobs/sha256/<digest>which was also causing a mismatch when searching the source from which to extract the files.zstd.NewReaderconstructor validates input, returning nil for non-zstd data and only failing later with magic number mismatch during readsfunc extractCompressedLayer(reader io.Reader, target string) error) https://github.com/wagoodman/dive/compare/main...Vortelf:dive:fix-file-extract-oci?expand=1#diff-41e690917a0067b8cdff96efaf54c45d60f9a80e17b2f12bc622aaa2086e2f94R349Misc