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

Question: how to inspect local image? #360

Open
qsLI opened this issue Jul 29, 2021 · 13 comments
Open

Question: how to inspect local image? #360

qsLI opened this issue Jul 29, 2021 · 13 comments

Comments

@qsLI
Copy link

qsLI commented Jul 29, 2021

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.

@dunklesToast
Copy link

For me it simply worked by using dive 482ca299fbe2. You can just put the image id or name / tag in there. Fetching image does not mean it's being pulled from Docker Hub, it's just fetching the image from the Docker Daemon as far as I understood.

@indera-shsp
Copy link

indera-shsp commented Aug 23, 2021

Does inspecting a local image create large temporary files? and where are they stored?

@abitrolly
Copy link
Contributor

@indera-shsp at least for podman inspecting uses podman image save which streams image in .tar format to stdout.

err, reader := streamPodmanCmd("image", "save", id)

Then the image is parsed on the fly.

func NewImageArchive(tarFile io.ReadCloser) (*ImageArchive, error) {

@oskar-gmerek
Copy link

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.
In above example I trying to dive via image id, but I also tried with image tag and get the same output.

@fedulovivan
Copy link

fedulovivan commented Sep 20, 2023

Still not possible to dive into local image neither by its name, nor by id.
dive 40bea9d7fd53 gives cannot fetch image
docker inspect 40bea9d7fd53 succeeds!

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

@yehudamakarov
Copy link

yehudamakarov commented Dec 20, 2023

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 dive b2b32512c2cf
i'm using docker desktop and maybe dive is trying to use the default context?

dive b2b32512c2cf
Image Source: docker://b2b32512c2cf
Fetching image... (this can take a while for large images)
Handler not available locally. Trying to pull 'b2b32512c2cf'...
Using default tag: latest
Error response from daemon: pull access denied for b2b32512c2cf, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
cannot fetch image
exit status 1

@mark2185
Copy link
Contributor

@yehudamakarov could you try building the branch fix/docker-context from source and test it out to see if it helps?

Just running go run main.go b2b32512c2cf should work.

@cdepillabout
Copy link

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 nix using dockerTools, so it is a gzipped tarball.

I was able to easily inspect it with dive like the following:

$ 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 gunzip to unzip the tarball on the fly, and pass the unzipped tarball to dive.

@iamludal
Copy link

iamludal commented Apr 1, 2024

Same as @yehudamakarov, it used to work for me, but it does not anymore.
I tried @mark2185's solution, but it does not seem to work either:

cannot fetch image
could not find image config
exit status 1

EDIT : I was running version 0.11.0, and upgrading to 0.12.0 seemed to solve the problem.

@mikejwhat
Copy link

this is annoying

@3manuek
Copy link

3manuek commented Apr 22, 2024

I upgraded to version 0.12.0 on Darwin and it works for me now.

@yehudamakarov
Copy link

i've been noticing it has been working for me not sure what the difference is. i was on 0.11.0

@parallaxe
Copy link

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?

Image Source: docker://1717b97bca46
Fetching image... (this can take a while for large images)
Handler not available locally. Trying to pull '1717b97bca46'...
Using default tag: latest
Error response from daemon: pull access denied for 1717b97bca46, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
cannot fetch image
exit status 1

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

No branches or pull requests