Remote API with Docker for Mac (BETA)

Is the Remote API available on Docker for Mac?
With docker-machne and regular linux docker versions I can access the API using localhost:2375/2376.
This doesn’t seem to work on Docker for Mac?


Workaround - using ‘socat’:

$ socat -d TCP-LISTEN:2376,range=,reuseaddr,fork UNIX:/var/run/docker.sock

$ curl localhost:2376/version


That’s a cool hack!

Thanks for sharing

You can even run socat in the Docker for Mac itself
docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 2376:2375 bobrik/socat TCP4-LISTEN:2375,fork,reuseaddr UNIX-CONNECT:/var/run/docker.sock


Does anyone know other ways that do not require installation of such utilities as socat?

Try this:
docker run -p 3375:2375 -v /var/run/docker.sock:/var/run/docker.sock -d -e PORT=2375 shipyard/docker-proxy

1 Like

the question is: is this just a “missing beta feature” or is it “missing by design”?
I hope not to find more workarounds in the near future but port 2375 being exported per default :slight_smile:

P.S: found this thread [worked around] Docker HTTP(S) API no longer available in beta9? via and related docker-java issues that read like “we won’t fix that, use the damn socket” :frowning:

P.S: the #known-issues do list this “solutions” too: