-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
base: main
Are you sure you want to change the base?
Conversation
Tested locally on my linux-amd64 with command: |
@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 |
There was a problem hiding this comment.
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 🤷)
@wagoodman I'm also not able to use dive because of this bug, and I'm running a compiled version of @Maddog2050's Is there anything blocking the PR? It would be great if you / we could get it sorted and pushed. Thanks! |
Does anyone know if there is an easy way to ask homebrew to install @Maddog2050 's fork? |
Hmmm
Well that was a deep rabbit hole. |
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 Hopefully this fix will get merged soon and we can just use the official binary! :) |
Fix works for me too :) I hope this gets merged soon! 🤞 |
Worked for me - this should get merged |
I'm running into this problem as well. Any reason the fix has been sitting around since it was approved back in March? |
Since Docker Desktop 4.34 https://docs.docker.com/desktop/release-notes/#4340
Can we merge it and release a new version? I checked this PR and it works fine. Thank you for this utility, @wagoodman ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix works
Thx. 👍 |
work on latest Docker Desktop 4.35.1 on Mac M2! thanks~~ |
Fixes wagoodman#507 Fixes wagoodman#510 Fixes wagoodman#526 Fixes wagoodman#534 Co-authored-by: Maddog2050 <[email protected]>
Fixes wagoodman#507 Fixes wagoodman#510 Fixes wagoodman#526 Fixes wagoodman#534 Co-authored-by: Maddog2050 <[email protected]>
Fixes wagoodman#507 Fixes wagoodman#510 Fixes wagoodman#526 Fixes wagoodman#534 Co-authored-by: Maddog2050 <[email protected]>
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 |
The fix was exactly what we needed here, thanks! |
@wagoodman Hey, first of all thanks for this great tool. Unfortunately it stopped working for me due to this issue. Can you have a look at this PR and approve/merge/release a new version? Thanks in advance |
@pascal-hofmann unfortunately it seems that Dive is currently unmaintained. If you're looking for a release with this PR merged in, you can find one in Joschi's fork |
That's sad. Maybe we should create an org and try to maintain it there together? @joschi What do you think? |
@pascal-hofmann that is under consideration, you can find it here It does not seem many have responded, and Joschi does not want to actively maintain it himself either I'd have offered assistance myself, but I do not know Go, and couldn't even get the makefile working 😅 |
* chore: configure Renovate (#1) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update github artifact actions to v4 (#20) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update docker/login-action action to v3 (#19) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update actions/setup-go action to v5 (#18) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update actions/checkout action to v4 (#17) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update actions/cache action to v4 (#16) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * build: use Go 1.23.x to build project * chore(deps): update build tools - golangci-lint v1.16.0: https://github.com/golangci/golangci-lint/releases/tag/v1.61.0 - GoReleaser v1.61.0: https://github.com/goreleaser/goreleaser/releases/tag/v1.26.2 - Chronicle v0.8.0: https://github.com/anchore/chronicle/releases/tag/v0.8.0 - Glow v1.5.1: https://github.com/charmbracelet/glow/releases/tag/v1.5.1 * chore: temporarily lower coverage threshold to 30% Old coverage: ``` go test -race -coverprofile ./.tmp/unit-coverage-details.txt ./... ? github.com/wagoodman/dive [no test files] ? github.com/wagoodman/dive/cmd [no test files] ? github.com/wagoodman/dive/dive [no test files] ? github.com/wagoodman/dive/dive/image [no test files] ok github.com/wagoodman/dive/dive/filetree 0.032s coverage: 58.0% of statements ? github.com/wagoodman/dive/dive/image/podman [no test files] ok github.com/wagoodman/dive/dive/image/docker 0.076s coverage: 43.6% of statements ? github.com/wagoodman/dive/runtime/ui [no test files] ? github.com/wagoodman/dive/runtime/ui/format [no test files] ? github.com/wagoodman/dive/runtime/ui/key [no test files] ok github.com/wagoodman/dive/runtime 0.531s coverage: 53.3% of statements ok github.com/wagoodman/dive/runtime/ci 0.087s coverage: 62.1% of statements ok github.com/wagoodman/dive/runtime/export 0.096s coverage: 100.0% of statements ? github.com/wagoodman/dive/runtime/ui/layout/compound [no test files] ? github.com/wagoodman/dive/runtime/ui/view [no test files] ok github.com/wagoodman/dive/runtime/ui/layout 0.021s coverage: 82.6% of statements ? github.com/wagoodman/dive/utils [no test files] ok github.com/wagoodman/dive/runtime/ui/viewmodel 1.202s coverage: 55.3% of statements Coverage: 57.5% ``` New coverage: ``` go test -race -coverprofile ./.tmp/unit-coverage-details.txt ./... github.com/wagoodman/dive/dive coverage: 0.0% of statements github.com/wagoodman/dive/cmd coverage: 0.0% of statements github.com/wagoodman/dive coverage: 0.0% of statements github.com/wagoodman/dive/dive/image coverage: 0.0% of statements github.com/wagoodman/dive/dive/image/podman coverage: 0.0% of statements ok github.com/wagoodman/dive/dive/filetree 1.027s coverage: 58.0% of statements ok github.com/wagoodman/dive/dive/image/docker 1.064s coverage: 43.6% of statements github.com/wagoodman/dive/runtime/ui coverage: 0.0% of statements github.com/wagoodman/dive/runtime/ui/format coverage: 0.0% of statements github.com/wagoodman/dive/runtime/ui/key coverage: 0.0% of statements github.com/wagoodman/dive/runtime/ui/layout/compound coverage: 0.0% of statements github.com/wagoodman/dive/runtime/ui/view coverage: 0.0% of statements ok github.com/wagoodman/dive/runtime 1.382s coverage: 53.3% of statements ok github.com/wagoodman/dive/runtime/ci 1.055s coverage: 62.1% of statements github.com/wagoodman/dive/utils coverage: 0.0% of statements ok github.com/wagoodman/dive/runtime/export 1.048s coverage: 100.0% of statements ok github.com/wagoodman/dive/runtime/ui/layout 1.012s coverage: 82.6% of statements ok github.com/wagoodman/dive/runtime/ui/viewmodel 2.202s coverage: 55.3% of statements Coverage: 31.8% Coverage below threshold of 55.0% ``` * chore(deps): update fountainhead/action-wait-for-check action to v1.2.0 (#25) https://github.com/fountainhead/action-wait-for-check/releases/tag/v1.2.0 * ci: validate Renovate configuration file on build * ci: add gomodTidy and gomodUpdateImportPaths post update options to Renovate * fix(deps): update module github.com/dustin/go-humanize to v1.0.1 (#5) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update alpine docker tag to v3.20 (#7) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update github.com/awesome-gocui/keybinding digest to 8602903 (#2) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/spf13/cobra to v0.0.7 (#6) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/fatih/color to v1.18.0 (#9) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/google/uuid to v1.6.0 (#10) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/sergi/go-diff to v1.3.1 (#11) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/cespare/xxhash to v2 (#21) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/docker/docker to v24.0.9+incompatible (#3) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/spf13/viper to v1.19.0 (#14) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/sirupsen/logrus to v1.9.3 (#12) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module golang.org/x/net to v0.30.0 (#15) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/spf13/cobra to v1 (#23) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/docker/docker to v27 (#22) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/docker/cli to v27.3.1+incompatible (#27) * ci: run Linux acceptance tests in parallel (#28) * chore(deps): update module logrusorgru/aurora to v4 (major) (#29) github.com/logrusorgru/aurora changed the license from the WTFPL to the Unlicense due to pkg.go.dev restrictions. Refs logrusorgru/aurora@304bc2c * build: squash Docker image layers (#30) Refs #535 * chore(deps): update Docker CLI version to 27.3.1 (#31) * ci: update GoReleaser configuration (#33) * chore(deps): update GoReleaser to v2.4.4 (major) (#32) * revert: run Linux acceptance tests in parallel This reverts commit 1971472. * ci: fix image name, actions/checkout@v4, docker/login-action name * fix: create `~/.docker` directory in Docker images (#34) Error: ``` ❯ docker run -ti --rm -v /var/run/docker.sock:/var/run/docker.sock joschi/dive:0.13.0-alpha.1 busybox:latest Image Source: docker://busybox:latest Extracting image from docker-engine... (this can take a while for large images) > could not determine docker host: stat /root/.docker: no such file or directory cannot fetch image unable to parse docker host `` ``` * build: added ppc64le support (#551) Co-authored-by: Pooja Shah <[email protected]> * fix: fix OCI format, GZIP file can be <1024 bytes (#511) Fixes #507 Fixes #510 Fixes #526 Fixes #534 Co-authored-by: Maddog2050 <[email protected]> * docs: fix typos (#531) Found via `codespell -L ot,te` and `typos --hidden --format brief` Closes #464 Co-authored-by: Kian-Meng Ang <[email protected]> * docs: add more Windows installation options to the README (#470) Fixes #346 Co-authored-by: Nikolas Grottendieck <[email protected]> * docs: Update README.md (#506) Made copy and paste easy for zsh users - auto escape character issue Co-authored-by: YóUnǎi <[email protected]> * docs: update the install command to the latest Go version (#509) `go get` no longer works with recent versions of `go`. Co-authored-by: Trevor Gross <[email protected]> * chore: remove repetitive words (#515) Co-authored-by: thirdkeyword <[email protected]> Signed-off-by: thirdkeyword <[email protected]> * fix: close tmp files (#517) Co-authored-by: guoguangwu <[email protected]> Signed-off-by: guoguangwu <[email protected]> * chore: fix phony ci-release target (#530) Co-authored-by: Richard Steinmetz <[email protected]> * docs: warning message for Snap approach on Ubuntu/Debian (#552) #546 demonstrates the trouble it may cause. Co-authored-by: Zhang Yuanfeng <[email protected]> * docs: update curl commands in README (#533) Co-authored-by: Ali Afsharzadeh <[email protected]> * feat: improve "Fetching" message (#482) The Fetching... message was confusing. This replaces it with a clearer messages to avoid confusion. Additional fix: show original error unless image is not found Only try doing a pull if the image isn't found. Everything else should just generate the error so the user can fix it. Fixes #360 Co-authored-by: Christian Höltje <[email protected]> * fix: line wrap toggle now updates status bar indicator (#497) Fixes #496 Co-authored-by: Scott Moore <[email protected]> * feat: show setuid, setgid and sticky attributes (#524) See https://en.wikipedia.org/wiki/File-system_permissions#Notation_of_traditional_Unix_permissions Co-authored-by: Alexander Yastrebov <[email protected]> * feat(docker): Honor the host specified in current docker context (#490) This patch adds support for detecting the "docker host" to connect to which is set in the current docker context. One can have multiple such contexts and one of them can be activated via `docker context use <context-name>`. Fixes #397 Fixes #408 Fixes #412 Fixes #463 Fixes #495 Co-authored-by: Rajiv Kushwaha <[email protected]> * fix: can't inspect ubuntu:24.04 with Podman (#476) The problem was caused by `net/url.Parse()`: ``` panic: parse "podman://ubuntu:24.04": invalid port ":24.04" after host ``` Failure: ``` $ ./dive podman://ubuntu:24.04 Image Source: docker://podman://ubuntu:24.04 Fetching image... (this can take a while for large images) Handler not available locally. Trying to pull 'podman://ubuntu:24.04'... cannot fetch image cannot find docker client executable ``` Success: ``` $ ./dive podman://ubuntu:24.04 Image Source: podman://ubuntu:24.04 ... $ ./dive ubuntu:24.04 --source podman Image Source: podman://ubuntu:24.04 ... $ ./dive podman://ubuntu:24.04 --source docker Image Source: podman://ubuntu:24.04 ... ``` Fixes #475 Co-authored-by: Anatoli Babenia <[email protected]> * fix: enable layer scrolling (#521) Fixes #469 Fixes #494 Fixes #540 Refs #473 Refs #478 Refs #520 Co-authored-by: st-gr <[email protected]> * feat: add layer-wise filesystem information to the analysis json file (#458) Add layer-wise filesystem information to the analysis which is written to a JSON file when running dive with `-j` or `--json` flag. Co-authored-by: Akash Nayak <[email protected]> * feat: add size to Layer Details view (#522) Refs #469 (comment) Co-authored-by: st-gr <[email protected]> * feat: add CTRL+e for extracting current focused file Refs #224 Co-authored-by: kaedwen <[email protected]> * feat: vim-like arrow, scroll, and close filtering motions (#501) * Adding configurable keybindings for up/down arrows (`k` and `j` vim motions can be used as alternative to up/down arrows). Thanks to @gwendolyngoetz for implementing this feature [Adding configurable keybindings for up/down arrows #499](#499) * Add configurable keybindings for left/right arrows (`h` and `l` vim motions can be used as alternative to left/right arrows) * Add `u` and `d` keys for page up/down alternatives (I didn't want to replace default `ctrl+u` toggle-unmodified-files keybinding so I used`u` and `d` like `Vimium` extension ) * Add `esc` key to close filtering (Implemented a new method by utilizing the existing toggle filter method, without touching its current behavior) Refs #129 Refs #415 Refs #499 Co-authored-by: Gwendolyn Goetz <[email protected]> Co-authored-by: Mehmet Ümit Özden <[email protected]> * fix: gracefully check for Docker configuration (#37) Refs jesseduffield/lazydocker#489 * refactor!: migrate Go module from wagoodman/dive to joschi/dive (#36) * refactor!: migrate Go module from wagoodman/dive to joschi/dive * fix: bring back :latest Docker image * feat: create multi-arch container images with AMD64 and ARM64 (#38) * feat: create multi-arch container images with AMD64 and ARM64 * fix: use joschi/dive:latest-amd64 in CI * ci: use correct container registry in `ci-test-docker-image` (#39) * docs: fix Homebrew instructions in README * fix(deps): update module golang.org/x/net to v0.31.0 (#40) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update suzuki-shunsuke/github-action-renovate-config-validator action to v1.1.1 (#43) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module golang.org/x/net to v0.32.0 (#44) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update alpine docker tag to v3.21 (#45) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/docker/cli to v27.4.1+incompatible (#46) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module golang.org/x/net to v0.33.0 (#48) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/docker/docker to v27.4.1+incompatible (#47) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module golang.org/x/net to v0.34.0 (#49) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/spf13/afero to v1.12.0 (#50) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/docker/cli to v27.5.0+incompatible (#51) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/docker/docker to v27.5.0+incompatible (#52) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/docker/cli to v27.5.1+incompatible (#54) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/docker/docker to v27.5.1+incompatible (#55) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: support oci zstd compression (#53) Co-authored-by: Jochen Schalanda <[email protected]> * fix(deps): update module github.com/klauspost/compress to v1.17.11 (#57) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module golang.org/x/net to v0.35.0 (#59) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/spf13/cobra to v1.9.0 (#60) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/spf13/cobra to v1.9.1 (#62) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/klauspost/compress to v1.18.0 (#63) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/docker/cli to v28 (#64) * fix(deps): update module github.com/docker/cli to v28 * Replace deprecated function in engineResolver.fetchArchive() --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jochen Schalanda <[email protected]> * build: bump Go toolchain from 1.23.x to 1.24.x (#61) * build: bump Go toolchain from 1.23.x to 1.24.x * chore(deps): bump golangci-lint from v1.61.0 to v1.64.5 * fix: non-constant format string in call to (*testing.common).Errorf * test: add layer_set_state_test * fix(deps): update module github.com/docker/cli to v28.0.1+incompatible (#66) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/docker/docker to v28.0.1+incompatible (#65) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module golang.org/x/net to v0.36.0 (#73) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module golang.org/x/net to v0.37.0 (#74) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/spf13/viper to v1.20.0 (#76) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/spf13/afero to v1.14.0 (#75) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * refactor!: revert module name back to github.com/wagoodman/dive Partially reverts e46f931 * chore: remove Renovate configuration Reverts aa75fbf * Revert "ci: validate Renovate configuration file on build" This reverts commit 8d93877. --------- Signed-off-by: thirdkeyword <[email protected]> Signed-off-by: guoguangwu <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Pooja Shah <[email protected]> Co-authored-by: Maddog2050 <[email protected]> Co-authored-by: Kian-Meng Ang <[email protected]> Co-authored-by: Nikolas Grottendieck <[email protected]> Co-authored-by: YóUnǎi <[email protected]> Co-authored-by: Trevor Gross <[email protected]> Co-authored-by: thirdkeyword <[email protected]> Co-authored-by: guoguangwu <[email protected]> Co-authored-by: Richard Steinmetz <[email protected]> Co-authored-by: Zhang Yuanfeng <[email protected]> Co-authored-by: Ali Afsharzadeh <[email protected]> Co-authored-by: Christian Höltje <[email protected]> Co-authored-by: Scott Moore <[email protected]> Co-authored-by: Alexander Yastrebov <[email protected]> Co-authored-by: Rajiv Kushwaha <[email protected]> Co-authored-by: Anatoli Babenia <[email protected]> Co-authored-by: st-gr <[email protected]> Co-authored-by: Akash Nayak <[email protected]> Co-authored-by: kaedwen <[email protected]> Co-authored-by: Gwendolyn Goetz <[email protected]> Co-authored-by: Mehmet Ümit Özden <[email protected]> Co-authored-by: steven-halaka <[email protected]>
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
Fixes #507
Fixes #534