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 · 8 comments

Comments

@thesilverbadger
Copy link

commented Aug 1, 2016

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

This comment has been minimized.

Copy link
Author

commented Aug 1, 2016

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Aug 9, 2016

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Sep 1, 2016

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link

commented Sep 13, 2016

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

@rkommisetty

This comment has been minimized.

Copy link

commented Nov 8, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.