-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Question: how to inspect local image? #360
Comments
For me it simply worked by using |
Does inspecting a local image create large temporary files? and where are they stored? |
@indera-shsp at least for dive/dive/image/podman/resolver_linux.go Line 36 in c7d121b
Then the image is parsed on the fly. dive/dive/image/docker/image_archive.go Line 23 in c7d121b
|
I have similar problem. dive fbbae5f27e2a
Image Source: docker://fbbae5f27e2a
Fetching image... (this can take a while for large images)
Handler not available locally. Trying to pull 'fbbae5f27e2a'...
Using default tag: latest
Error response from daemon: failed to resolve reference "docker.io/library/fbbae5f27e2a:latest": pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
cannot fetch image
exit status 1 This is local image, not available on hub. |
Still not possible to dive into local image neither by its name, nor by id. Workaround is wrappring into script like: IMAGE_NAME="${1}"
TMP_FILE=/tmp/dive-tmp-image.tar
docker save "$IMAGE_NAME" > $TMP_FILE && dive $TMP_FILE --source=docker-archive && rm $TMP_FILE |
this definitely used to work for me (way after this issue was opened), i thought i was crazy and i see everyone else can't
|
@yehudamakarov could you try building the branch fix/docker-context from source and test it out to see if it helps? Just running |
I had the same question of how to inspect a local docker image in a tarball. The docker image I am working with is built by I was able to easily inspect it with $ nix-build ... # build the docker image
...
/nix/store/q9hl1xlcyglqlc4jp0yzm7riajjymmrg-my-docker-image.tar.gz
$ dive --source docker-archive <(gunzip -c /nix/store/q9hl1xlcyglqlc4jp0yzm7riajjymmrg-my-docker-image.tar.gz) This uses |
Same as @yehudamakarov, it used to work for me, but it does not anymore.
EDIT : I was running version 0.11.0, and upgrading to 0.12.0 seemed to solve the problem. |
this is annoying |
I upgraded to version 0.12.0 on Darwin and it works for me now. |
i've been noticing it has been working for me not sure what the difference is. i was on 0.11.0 |
Still having this issue on macOS 14.3. Updated dive to 0.12 and Docker Desktop to 4.30.0. Didn't help. Any more ideas?
|
+1 |
I get a different error using :
|
dive version not working :
docker inspect works:
|
@andreish need to ensure that your shell and dive/dive/image/docker/engine_resolver.go Line 89 in 925cdd8
|
dive version working normally
|
Have the same issue, can confirm that @fedulovivan script works. You can just wrap it into a function function dive_local
set IMAGE_NAME $argv[1]
if test -z "$IMAGE_NAME"
echo "Usage: dive_local_image <image_name_or_id>"
return 1
end
set TMP_FILE (mktemp /tmp/dive-tmp-image.XXXXXX.tar)
docker save "$IMAGE_NAME" > "$TMP_FILE"
if test $status -eq 0
dive "$TMP_FILE" --source=docker-archive
rm "$TMP_FILE"
else
echo "Failed to save Docker image."
rm "$TMP_FILE"
return 1
end
end dive_local <image-id> |
Having a similar issue when trying to inspect local images using docker desktop on windows
Info
Built using
Tried using --source the following ways
Sadly they all failed |
Can you prove it? |
No as a matter of fact, based on your question I spent the last 15 mins trying every version since release and can no confirm without a doubt that it never worked :-D |
@ondrovic then it is useless for the sake of this discussion. There are old versions that you can try, but if might have used local name instead of hash. It could be the case that Docker changed the protocol, but without proof that it worked, your issue report is useless. It doesn't specify the version of In any case, the project doesn't have any funding and is not maintained. I guess the only way a new releases are made is when problem is escalated with some corporation and they give @wagoodman money to spend time on fixing it. |
On dive 0.12.0 I can inspect a local image just fine with |
Uhm using % dive --version
dive 0.12.0 when running
|
the only solution worked was the script by @fedulovivan #!/bin/bash
IMAGE_NAME="${1}"
DELETE_FILE="${2}" # yes | no
# Check if the image file exists
if [ -f "$TMP_FILE" ]; then
echo "Image file $TMP_FILE already exists. Skipping docker save."
else
docker save "$IMAGE_NAME" > $TMP_FILE
fi
# Run dive on the image file
dive $TMP_FILE --source=docker-archive
# Check if the user wants to delete the file
if [ "$DELETE_FILE" == "yes" ]; then
echo "Deleting the temporary file $TMP_FILE."
rm $TMP_FILE
else
echo "Keeping the temporary file $TMP_FILE."
fi
|
You're doing |
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 wagoodman#360 Co-authored-by: Christian Höltje <[email protected]>
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 wagoodman#360 Co-authored-by: Christian Höltje <[email protected]>
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 wagoodman#360 Co-authored-by: Christian Höltje <[email protected]>
One-liner without temporary files:
Those that say "works for me" are probably running
Which will fail:
Probably, as a sane default, when unable to get to the local storage it should:
|
Can confirm |
how to # ./dive version
dive 0.12.0
# ctr images export 5.tar test.img.com/image/app:0.0.1
# ./dive --source docker-archive ./5.tar
Image Source: docker-archive://./5.tar
Fetching image... (this can take a while for large images)
cannot fetch image
could not find 'blobs/sha256/e85e534aa5d895d8ad44fdb2e660d158462c054f5a53e0f6baf7af6ded844ba7' in parsed layers I unpacked the tarball and confirmed that there are blobs/sha256/e85e534aa5d895d8ad44fdb2e660d158462c054f5a53e0f6baf7af6ded844ba7 |
I struggled a lot with Anyway I was able to solve it by running In particular first get the right socket, in my case
Then use
Without the |
Can we skip pulling from hub,using local image insted?
My image is imported via command
docker load -i
, and it's not avaliable in registry.The text was updated successfully, but these errors were encountered: