wagoodman / dive

A tool for exploring each layer in a docker image
MIT License
47.34k stars 1.79k forks source link

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

Open Maddog2050 opened 9 months ago

Maddog2050 commented 9 months ago

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 commented 8 months ago

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

yoav-orca commented 7 months ago

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

jjmaestro commented 4 months ago

@wagoodman I'm also not able to use dive because of this bug, and I'm running a compiled version of @Maddog2050's fix-oci-format branch without problem.

Is there anything blocking the PR? It would be great if you / we could get it sorted and pushed.

Thanks!

gabrieljones commented 3 months ago

Does anyone know if there is an easy way to ask homebrew to install @Maddog2050 's fork?

gabrieljones commented 3 months ago

Hmmm

> go install github.com/Maddog2050/dive@fix-oci-format
go: downloading github.com/Maddog2050/dive v0.0.0-20240223132924-5dd9ba6e48f9
go: github.com/Maddog2050/dive@fix-oci-format: version constraints conflict:
    github.com/Maddog2050/dive@v0.0.0-20240223132924-5dd9ba6e48f9: parsing go.mod:
    module declares its path as: github.com/wagoodman/dive
            but was required as: github.com/Maddog2050/dive

Well that was a deep rabbit hole.

jjmaestro commented 3 months ago

Does anyone know if there is an easy way to ask homebrew to install @Maddog2050 's fork?

Not that I know of... I "just" did:

git clone https://github.com/Maddog2050/dive.git
git co fix-oci-format
make bootstrap
make build

Then, I alias dive=$PWD/snapshot/dive_darwin_arm64/dive. You can also make help to check the different make targets they have.

Hopefully this fix will get merged soon and we can just use the official binary! :)

otherguy commented 3 months ago

Fix works for me too :) I hope this gets merged soon! 🤞

gthomson31 commented 3 months ago

Worked for me - this should get merged

kwaegel commented 2 months ago

I'm running into this problem as well. Any reason the fix has been sitting around since it was approved back in March?

Razorr1996 commented 2 months ago

Since Docker Desktop 4.34 containerd is a default image store, so a lot of people will face this problem.

https://docs.docker.com/desktop/release-notes/#4340

Fresh installations of Docker Desktop now use the containerd image store by default.

Can we merge it and release a new version? I checked this PR and it works fine.

Thank you for this utility, @wagoodman !

coronarita1991 commented 1 month ago

Thx. 👍

dkthezero commented 3 weeks ago

work on latest Docker Desktop 4.35.1 on Mac M2! thanks~~

solidDoWant commented 1 week ago

If anybody is interested, I built an image for this PR and pushed it here: https://github.com/users/solidDoWant/packages/container/dive/306957285?tag=v0.12.0-1-g5dd9ba6