Beta18: Creates wrong socket link [FIXED in GA]

Expected behavior

“docker ps -s” should be functional. (This used to work on beta16 and earlier.)

Actual behavior

“Cannot connect to the Docker daemon” (beta 17, 18.0, 18.1)
Exit code 1

Information

This happens because for some reason docker does not set the docker.sock soft link correctly:
red:~ robert$ ls -la /var/run/docker.sock
lrwxr-xr-x 1 root daemon 61 Jul 9 14:58 /var/run/docker.sock -> /var/_xcsbuildd/Library/Containers/com.docker.docker/Data/s60
red:~ robert$ whoami
robert
red:~ robert$

Docker does this on every restart of the “whale”. I tried a complete uninstall and wipe and it’s reproducible.
The fix is trivial: by removing the link and setting it correctly, the system works:
sudo ln -s /Users/robert/Library/Containers/com.docker.docker/Data/s60 /var/run/docker.sock
However, this has to be done every time Docker starts.

The “robert” user id is 501, the “_xcsbuildd” user is 262.

This is on a Mac that has OS X server installed and several services running (including the Xcode service).

Steps to reproduce the behavior

  1. Reinstall OR restart beta17 or beta18 on a Mac with OS X server and Xcode build server.
  2. docker ps -s

Bug still present in beta 19.

Present on Version 1.12.0-rc4-beta20 (build: 10404) as well. I also have Xcode Server installed with the Xcode service enabled. It sort of looks like Server may be taking over the docker socket… could it be that it actually uses docker for some things? Not entirely sure this is a docker issue.

In my case, _xcsbuildd’s uid is 263.

The following command fixes the issue until the next time the docker app starts, which brings back the incorrect setting:

sudo ln -fs "$HOME/Library/Containers/com.docker.docker/Data/s60" /var/run/docker.sock

For me, this is fixed in beta 20 and the GA.