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

Dive always fail when trying to fetch local image #462

Closed
joaocasarin opened this issue Jul 13, 2023 · 10 comments
Closed

Dive always fail when trying to fetch local image #462

joaocasarin opened this issue Jul 13, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@joaocasarin
Copy link

I have a local image called jcasarin:t with id d18bf00f8397. When I run dive d18bf00f8397 or dive jcasarin:t it always fail with the following response:

Image Source: docker://d18bf00f8397
Fetching image... (this can take a while for large images)
Handler not available locally. Trying to pull 'd18bf00f8397'...
Using default tag: latest

Error response from daemon: pull access denied for d18bf00f8397, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
cannot fetch image
exit status 1

Although fetching image doesn't necessarily means it is pulling from docker hub, it does seem to be trying to do that.

I have already ran docker login docker.io and also docker login <my_company_docker_registry> and both are already authenticated, but still get that deny error.

PS.: I did not push the image to any registry, it is just local!

@joaocasarin joaocasarin added the bug Something isn't working label Jul 13, 2023
@mark2185
Copy link
Contributor

Handler not available locally. Trying to pull 'd18bf00f8397'...
Using default tag: latest

This means it will try to pull an image named d18bf00f8397 with the tag latest which is not what you want.

Could you please post the output of docker images | grep jcasarin and dive jcasarin:t?

Also, which version of dive are you using?

@joaocasarin
Copy link
Author

Hi @mark2185 ,
as requested this is the output of the first command:
image

second command:
image

dive version: dive 0.10.0

@jmbowman
Copy link

I suspect this is the same issue resolved by #453 (comment) . It happens when newer versions of Docker Desktop are installed without admin privileges on macOS.

@joaocasarin
Copy link
Author

@jmbowman interesting, perhaps it has something to do with the docker client I am using then. We are not allowed to use Docker Desktop so we have an internal docker client, may that be the cause?

@grumpyp
Copy link

grumpyp commented Jul 25, 2023

maybe also related to: #452

@joske
Copy link

joske commented Aug 2, 2023

I have the same issue on macOS. Using colima as docker engine. Dive tries to pull the image (and fails) while it's just available locally.

@joaocasarin
Copy link
Author

Hi,
just wanted to share here I found the solution for our internal tool.
We needed to export following environment variables:

DOCKER_CERT_PATH=$(docker context inspect -f '{{ .Storage.TLSPath }}/docker')
DOCKER_HOST=$(docker context inspect -f '{{ .Endpoints.docker.Host }}')
DOCKER_TLS_VERIFY=1
export DOCKER_CERT_PATH DOCKER_HOST DOCKER_TLS_VERIFY

After doing that, I could use dive as usual in the current terminal session.

maybe you want to take a look about these variables with the dev of colima, @joske ?

@baggiponte
Copy link

baggiponte commented Oct 3, 2023

maybe you want to take a look about these variables with the dev of colima, @joske ?

Hi @joaocasarin, I am using colima too and just found I have the same problem. Are you saying I should export those variables and see if this works for colima as well? Thanks!

EDIT: I tried this and this is the error that was raised:

Image Source: docker://omi-kml
Fetching image... (this can take a while for large images)
cannot fetch image
could not read CA certificate "/Users/luca/.docker/contexts/tls/f24fd3749c1368328e2b149bec149cb6795619f244c5b584e844961215dadd16/docker/ca.pem": open /Users/luca/.docker/contexts/tls/f24fd3749c1368328e2b149bec149cb6795619f244c5b584e844
961215dadd16/docker/ca.pem: no such file or directory

I am not sure where colima stores the certificates..

@joaocasarin
Copy link
Author

maybe you want to take a look about these variables with the dev of colima, @joske ?

Hi @joaocasarin, I am using colima too and just found I have the same problem. Are you saying I should export those variables and see if this works for colima as well? Thanks!

EDIT: I tried this and this is the error that was raised:

Image Source: docker://omi-kml
Fetching image... (this can take a while for large images)
cannot fetch image
could not read CA certificate "/Users/luca/.docker/contexts/tls/f24fd3749c1368328e2b149bec149cb6795619f244c5b584e844961215dadd16/docker/ca.pem": open /Users/luca/.docker/contexts/tls/f24fd3749c1368328e2b149bec149cb6795619f244c5b584e844
961215dadd16/docker/ca.pem: no such file or directory

I am not sure where colima stores the certificates..

Hi, actually I use our own internal implementation of docker engine, not Colima. I was told about those variables so we could use Dive, but probably the developers of Colima should know better what to do in order to get it working as well...

Perhaps you open an issue on Colima's repo and mention this thread?

@arunvelsriram
Copy link

Setting DOCKER_HOST correctly solved the issue for me.

export DOCKER_HOST=$(docker context inspect -f '{{ .Endpoints.docker.Host }}')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants