Docker Community Forums

Share and learn in the Docker community.

Which DOCKER_HOST?


(Tobias Gesellchen) #1

I want to connect with a 3rd party client to the Docker for Windows engine. Using unix:///var/run/docker.sock doesn’t work. Which socket or connection string should I use?


(Rolf Neugebauer) #2

Hi Tobias

do you want to connect it on the Windows host? Then in Beta6 (and with docker 1.11.0-rc3) the default is to connect to a named pipe called //./pipe/docker_engine. We still support connecting to localhost:2375

Note, however, that we currently don’t support third party docker clients

rolf


(Tobias Gesellchen) #3

Hi Rolf,

thanks for the quick reply! Connecting to localhost:2375 works.

Would it make sense for the “Docker for Windows” installer to configure the environment with an explicit value for DOCKER_HOST, then? Since the unix socket is the default in a clean environment (without DOCKER_HOST), existing client libraries and their users would be forced to configure the DOCKER_HOST. Otherwise they would need to check on which operating system they’re running, which feels not the way it could be.

I’m fine with the current lack of support for third party clients, nevertheless this minor issue might be relevant when other clients shall integrate as easy as possible. :slight_smile:

Digging a bit deeper: do you know of any plans whether the named pipe and/or the tcp socket will be available “forever”?

Tobias


(Rolf Neugebauer) #4

Hi Tobias

I don’t know what the plans are regarding the future and we don’t really want to set the DOCKER_HOST env variable. Our plan for Docker for Windows is to support whatever the default is for the docker CLI. For this beta we support both the named pipe and localhost:2375 because the move to the named pipe on windows was a very recent change (in one of the 1.11 RCs IIRC) but we’ll probably remove the localhost:2375 support once the named pipe mechanism stabilises.

I think you’d have to check which OS you are running on anyway. On Unix the Unix domain socket is the default, on windows, i believe the named pipe is already or will become the default.

Rolf


(Tobias Gesellchen) #5

Hi Rolf,

thanks for the insights! At least not to hear about named pipes going away is enough for me to be prepared for them.

Tobias