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

Cannot connect to the Docker daemon. Is the docker daemon running on this host? #47

Closed
thesilverbadger opened this issue Aug 1, 2016 · 9 comments

Comments

@thesilverbadger
Copy link

This has just started very recently (last ran Docker last week). Looks to be a duplicate of #42, although that issue is sparse of details.

Diagnostic ID: DEDC5D44-B2E1-4661-8003-309D06286A47
Docker for Mac: 1.12.0 (Build 10871)
macOS: Version 10.11.6 (Build 15G31)
[ERROR] docker-cli
/var/run/docker.sock does not exist
Permission denied (EACCES) connecting to /var/run/docker.sock: check permissions
docker ps failed
[OK] app
[OK] moby-syslog
[OK] disk
[OK] virtualization
[OK] system
[OK] menubar
[OK] osxfs
[OK] db
[OK] slirp
[OK] moby-console
[OK] logs
[OK] vmnetd
[OK] env
[OK] moby
[OK] driver.amd64-linux

Steps to reproduce

  1. Running any docker commands in Terminal (e.g. docker info).
  2. I've tried resetting and uninstalling using the Uninstall/Reset option in Preferences, then reinstalling using a fresh download. No luck.
@thesilverbadger
Copy link
Author

To follow up on this, installing on a different Mac that hasn't had Docker for Mac installed before works correctly. So seems to be an update problem?

@dkvk
Copy link

dkvk commented Aug 2, 2016

Hi, I have this issue as well.

I found out that the symlink to the docker.sock was linked wrong. It's easy to work around, although it's a hack and I hope it's getting fixed in later versions.

To find out if your docker.sock file is wrongly linked do:

ls -la /var/run/docker.sock
lrwxr-xr-x  1 root  daemon  59  2 Aug 11:44 /var/run/docker.sock -> /var/root/Library/Containers/com.docker.docker/Data/s60

The link is to a file under /var/root which seems to be wrong.

The hack around this is to recreate the symlink to where it should live:
sudo ln -sf ~/Library/Containers/com.docker.docker/Data/s60 /var/run/docker.sock
This should recreate the symlink pointing to the right file under your user folder.

To verify do:

ls -la /var/run/docker.sock
lrwxr-xr-x  1 root  daemon  59  2 Aug 11:44 /var/run/docker.sock -> /Users/daniel/Library/Containers/com.docker.docker/Data/s60

And as you can see the docker.sock file is now linked to the corresponding file under the users folder.

It seems that this has to be done every time you start/restart Docker on the computer.

@jonashaag
Copy link

Same problem, just installed Docker for Mac, never had Docker on the machine before. I used the stable .dmg from the official site and haven't changed any settings -- so, pretty much a vanilla setup that should just work.

@adi-li
Copy link

adi-li commented Aug 17, 2016

Same issue here, but my symlink is linked to /var/_xcsbuildd/Library/Containers/com.docker.docker/Data/s60.

The problem was found after I installed the Xcode Server.

@jamieshaw
Copy link

Me too. Same problem, enabling Xcode Server (Xcode server was configured but disabled before Docker installation) changed the symlink of the socket to:
/var/_xcsbuildd/Library/Containers/com.docker.docker/Data/s60

@djs55
Copy link
Contributor

djs55 commented Sep 6, 2016

I've created a patch to improve the way we compute the symlink directory, which will hopefully fix this issue. Unfortunately it's too late for beta 25 but it should be in beta 26. I'll let you know when the patch is available for testing.

@mchiang0610
Copy link

Closing since it may be fixed. Otherwise, may also be similar to #119

@rkommisetty
Copy link

When I installed docker using brew cask install docker on my mac. I couldn't even find the docker.sock file in /var/run folder.

Then I uninstalled docker using brew cask uninstall docker and then downloaded the .dmg file from docker website

https://store.docker.com/editions/community/docker-ce-desktop-mac

and installed it. Everything looks normal now. I can run docker as expected.

sh-3.2# cd /var/run
sh-3.2# ls -al dock*
lrwxr-xr-x 1 root daemon 64 Nov 8 12:01 docker.sock -> /Users/rkommisetty/Library/Containers/com.docker.docker/Data/s60

sh-3.2# cd /var/run
sh-3.2# ls -al dock*
lrwxr-xr-x 1 root daemon 64 Nov 8 12:01 docker.sock -> /Users/rxxxxxxxxxy/Library/Containers/com.docker.docker/Data/s60
sh-3.2# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
sh-3.2# exit
exit
xxxxxxxxxx:~ rxxxxxxxxxy$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
sh-3.2# cd /var/run
sh-3.2# ls -al dock*
lrwxr-xr-x 1 root daemon 64 Nov 8 12:01 docker.sock -> /Users/rxxxxxxxxy/Library/Containers/com.docker.docker/Data/s60
sh-3.2# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
sh-3.2# exit
exit
user$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants