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 use dive with M1 and colima? #408

Open
wujek-srujek opened this issue Jun 28, 2022 · 4 comments
Open

[Question] How to use dive with M1 and colima? #408

wujek-srujek opened this issue Jun 28, 2022 · 4 comments

Comments

@wujek-srujek
Copy link

I build an image, let's call it new_1:

$ docker images
REPOSITORY   TAG       IMAGE ID       CREATED             SIZE
new_1        latest    f2c3c30fca2d   About an hour ago   179MB
...

and would like to dive into it, but it fails:

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

What is the exact issue here, and what can I do to make it work (if anything?). It does work with:

docker save new_1 > new_1.tar
dive docker-archive://new_1.tar

that I stole from #397 (comment), but is it the only way?

@lincoln-spiteri
Copy link

This works for me

docker context list
export DOCKER_HOST=unix:///<path_to_user_dir>/.colima/default/docker.sock
dive <my_container>

The first command should give you something like:

NAME        DESCRIPTION                               DOCKER ENDPOINT                                            KUBERNETES ENDPOINT   ORCHESTRATOR
colima      colima                                    unix:///Users/lincolnspiteri/.colima/default/docker.sock
default *   Current DOCKER_HOST based configuration   unix:///var/run/docker.sock                                                      swarm

Then set your DOCKER_HOST to the colima Docker endpoint.

@wujek-srujek
Copy link
Author

Thanks @lincoln-spiteri , It works but after I set the DOCKER_HOST issuing docker context list show the following warning:
Warning: DOCKER_HOST environment variable overrides the active context. To use a context, either set the global --context flag, or unset DOCKER_HOST environment variable.
which sounds like it could break some other stuff for me. It is also arguably even more complex than just exporting the tar and diving into that.

@tmaier
Copy link

tmaier commented Nov 27, 2022

Adding on @lincoln-spiteri:

You can streamline this with $ export DOCKER_HOST=$(docker context inspect --format='{{.Endpoints.docker.Host}}')

@docwhat
Copy link

docwhat commented Apr 20, 2023

If the engine is set to docker, should dive fetch the DOCKER_HOST itself?

I have the same problem with the Rancher Desktop docker app macOS, and my socket is in ~/.rd/docker.sock

I don't run the bit that needs the administrator access every startup to put the socket in /var/run/docker.sock

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

4 participants