gradle-docker-plugin: docker for mac 1.12 cannot connect
Getting this.
Tried setting DOCKER_HOST to the docker socket but this gradle task still doesn’t work
[dockerjava-jaxrs-async-0] ERROR com.github.dockerjava.core.async.ResultCallbackTemplate - Error during callback
org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1, localhost/fe80:0:0:0:0:0:0:1%1] failed: Connection refused
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
at com.github.dockerjava.jaxrs.connector.ApacheConnector.apply(ApacheConnector.java:437)
If i try
docker {
url = "unix:///var/run/docker.sock"
}
I get
java.lang.UnsatisfiedLinkError: Could not find library in classpath, tried: [libjunixsocket-macosx-1.8-x86_64.dylib, libjunixsocket-macosx-1.5-x86_64.dylib]
at org.newsclub.net.unix.NativeUnixSocket.load(NativeUnixSocket.java:81)
at org.newsclub.net.unix.NativeUnixSocket.<clinit>(NativeUnixSocket.java:112)
at org.newsclub.net.unix.AFUNIXSocket.<init>(AFUNIXSocket.java:36)
at org.newsclub.net.unix.AFUNIXSocket.newInstance(AFUNIXSocket.java:50)
at com.github.dockerjava.jaxrs.ApacheUnixSocket.<init>(ApacheUnixSocket.java:51)
at com.github.dockerjava.jaxrs.UnixConnectionSocketFactory.createSocket(UnixConnectionSocketFactory.java:65)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:118)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
? https://forums.docker.com/t/worked-around-docker-http-s-api-no-longer-available-in-beta9/10474/6
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 18 (2 by maintainers)
Force upgrading Docker Java’s
unix-socket-factorydependency worked for me. Using Docker for Mac 1.12.0-a (stable) and docker-java-application 3.0.2.This definitely aids the issue
or /var/tmp/docker.sock (depends on your local setup)
@cdancy I just tested my use case again. Some parts are indeed not working. My gradle build starts but has issues. Appreciate your offer but I realize that a new version would not help here.
I had Docker for Mac 1.11 working using this recipe:
Docker for Mac 1.12 broke with the server API compatibility. At which point I uninstalled and am using docker-machine exclusively.