Docker Community Forums

Share and learn in the Docker community.

Can we have unique default connection urls across platforms?

(Tobias Gesellchen) #1

Expected behavior

Third party Docker clients should be able to resolve the DOCKER_HOST easily, even when the environment variable is not configured. Without explicit configuration there should be a well-known default every client should try to connect to.

Actual behavior

We have the ultimate default of unix:///var/run/docker.sock, with the option to override by using command line options or the environment variable DOCKER_HOST. With Docker for Mac/Windows the default strategy is also via unix domain socket, but at the different filename unix:///var/tmp/docker.sock.


Checked on Docker for Mac 1.11.0-beta6

It would be easier for third-party client maintainers to have a unique default. Otherwise we’d have to force the user to configure explicitly or make libraries perform guesses by trying “all known defaults for all platforms”.

Would it be possible to change the current Docker for Mac/Windows unix socket path from /var/tmp/docker.sock to /var/run/docker.sock?

(Justin Cormack) #2

You should use /var/run/docker.sock on the Mac too.

The recommendation is for any application to pick the platform defaults ie /var/run/docker.sock on Mac if the environment variables are not set.

(Tobias Gesellchen) #3

Oh my. You’re right, I didn’t notice that it’s linked to the /var/tmp/docker.sock file.