Search code examples
macosgradledockerdocker-machinebroken-pipe

Gradle Docker plugin broken pipe on osx


Hi I try to use this awesome Gradle plugin: https://github.com/bmuschko/gradle-docker-plugin I use the following URL obtained from my docker-machine / kitematic installation on osx:

docker-machine url default
tcp://192.168.99.100:2376

However using:

url = "tcp://192.168.99.100:2376"

results in the error:

org.apache.http.conn.UnsupportedSchemeException: tcp protocol is not supported

When I change the tcp to httpI get a different error:

INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request: Broken pipe
[pool-4-thread-1] ERROR com.github.dockerjava.core.async.ResultCallbackTemplate - Error during callback
org.apache.http.client.ClientProtocolException

in case the gradle dockerBuildImage task is run. But manually building the Dockerfile created by gradle works without any problems.

The following code can be used to replicate the problem. https://github.com/geoHeil/lab04/blob/master/build.gradle


Solution

  • Docker-machine enables TLS by default. I Switching to the TLSmode should be a good solution:

    url = 'https://192.168.59.103:2376'
    certPath = new File(System.properties['user.home'], '.boot2docker/certs/boot2docker-vm')