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 · 13 comments
Open

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

hariprasadpo28 opened this issue May 24, 2023 · 13 comments

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

@cjconnor24
Copy link

Awesome @Tantalor93 - this was sooo annoying thank you :)

@delanym
Copy link

delanym commented Aug 27, 2024

Following instructions to setup rootless docker on ubuntu 24.04 I end up with a $DOCKER_HOST of unix:///run/user/1000/docker.sock and I still get "cannot find docker client executable".

@williamdes
Copy link

And did you run my command above?

@delanym
Copy link

delanym commented Aug 27, 2024

@williamdes I already have a /var/run/docker.sock. I renamed it temporarily and tried your command. Dive still complains

$ dive redmine:5.1.3-alpine
Image Source: docker://redmine:5.1.3-alpine
Fetching image... (this can take a while for large images)
Handler not available locally. Trying to pull 'redmine:5.1.3-alpine'...
cannot fetch image
cannot find docker client executable

@williamdes
Copy link

cannot find docker client executable

Seems explicit, does docker --version work ?

@delanym
Copy link

delanym commented Aug 27, 2024

I setup it up last week. Everything working. Docker version 27.1.2, build d01f264
Rather than fiddling with my system it would be more convenient to configure the socket dive should connect to

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.

9 participants