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

Unable to connect to docker.sock file while running dive #453

Open
hariprasadpo28 opened this issue May 24, 2023 · 7 comments · May be fixed by #463
Open

Unable to connect to docker.sock file while running dive #453

hariprasadpo28 opened this issue May 24, 2023 · 7 comments · May be fixed by #463

Comments

@hariprasadpo28
Copy link

I have been trying to run dive on some of my images, after running dive ubuntu:latest I am seeing this error:

Image Source: docker://ubuntu:latest Fetching image... (this can take a while for large images) Handler not available locally. Trying to pull 'ubuntu:latest'... latest: Pulling from library/ubuntu Digest: sha256:dfd64a3b4296d8c9b62aa3309984f8620b98d87e47492599ee20739e8eb54fbf Status: Image is up to date for ubuntu:latest docker.io/library/ubuntu:latest cannot fetch image Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

But I am able to use docker without any problems, docker is also running.
OS: MacOS 13.4
Docker engine: v23.0.5

@kfrapin
Copy link

kfrapin commented Jun 2, 2023

Edit 2023-07-10
A better solution is described by @Tantalor93 below
#453 (comment)

Original proposed solution
I had the same problem, but this is not an issue related to dive, this is more related to Docker and how docker.sock seems to be managed on Mac now.

A Docker upgrade on Mac moved the docker.sock from /var/run/ to ~/.docker/run/

An easy fix is:

ln -s ~/.docker/run/docker.sock /var/run/docker.sock

If sudo is required:

sudo ln -s ~/.docker/run/docker.sock /var/run/docker.sock

Note sure how long this fix can work, but for now, it is doing the job!

@Tantalor93
Copy link

If you are using Docker Desktop on Mac, you can enable the option for creating the default Docker socket
image

@jmbowman
Copy link

This looks like a change in Docker Desktop 4.18 to allow installation on macOS without needing admin privileges: https://www.docker.com/blog/docker-desktop-4-18/ . It still asks for admin privileges, but if you don't grant them then tools like dive won't work until you enable this new setting.

@nigelwtf
Copy link

This could be worth adding as a note to the installation steps. I ran into this issue too!

I haven't used my personal computer in quite a long time for programming. My Docker client updated itself to Docker Desktop - and at no point during the upgrade process did it prompt me for a password (and luckily I kind of stumbled onto this fix myself) 😅

@diei
Copy link

diei commented Jul 19, 2023

I get a similar error since I switched from Docker Desktop to colima at my MacBook (Ventura 13.3.1). Dive (0.11.0) can not load a local image. Docker version is 24.0.4.

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

@diei
Copy link

diei commented Jul 20, 2023

The post of TG-KK in #397 (comment) helped me.

@williamdes
Copy link

For docker rootless: sudo ln -s /run/user/$(id -u)/docker.sock /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

Successfully merging a pull request may close this issue.

7 participants