I'm trying to get docker-java (https://github.com/docker-java/docker-java) to work with Docker for mac (https://docs.docker.com/docker-for-mac/).
How can I set the equivalent of:
DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock"
On the mac version of Docker?
$ docker info
HTTP Proxy: docker.for.mac.http.internal:3128
HTTPS Proxy: docker.for.mac.http.internal:3129
Registry: https://index.docker.io/v1/
Hope this helps
This is probably because you don't have a machine running.
If the output is stating that no default machine, then execute,
This will create a default machine and the connection will be successful.
If you are using the last docker for mac beta, according to issue 25064:
Note: if
~/Library/Containers/com.docker.docker/Data/database/
does not containcom.docker.driver.amd64-linux
, go to thatdatabase/
folder, and do agit reset --hard
.As mentioned by the OP Michael Nelson in the comments, and detailed in "Docker for Windows" (which has sections relevant for "Docker for Mac")
There is a related answer which suggests a workaround using
socat
.It does indeed work to expose port 2375 on the network:
Reference: Access Docker daemon Remote api on Docker for Mac