Skip to content
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

Fix OCI format, GZIP files can be smaller than 1024 bytes #511

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Maddog2050
Copy link

Here is a simple fix for the OCI format. When debugging I found that the GZIP size can be less than 1024 bytes when using containerd to pull the image.

I have tested with and without the "Use containerd for pulling and storing images" option in docker desktop and it appears to have fixed the issue. I also noticed issue #507 and downloading the example file it appears to resolve this issue also.

Fixes: #510 #507

@Rud5G
Copy link

Rud5G commented Mar 28, 2024

Tested locally on my linux-amd64 with command: dive python:3.9.19-slim-bookworm

@yoav-orca
Copy link

@wagoodman can you merge this? I'm unable to use dive lately due to this bug

// Not a gzipped entry
unwrappedReader = io.MultiReader(bytes.NewReader(buffer[:n]), tarReader)
}
// Try reading a GZIP
Copy link
Contributor

Choose a reason for hiding this comment

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

Fwiw, the comment above (line 97) about Docker not gzipping very small layers might have to be removed (unfortunately, GitHub doesn't let me put that comment on that line 🤷)

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.

Docker containerd format fails to parse layers with dive 0.12.0
4 participants