I have added bmuschko/gradle-docker-plugin into a Gradle build.gradle file to automate copying a war file into a running container. The file copy command of this plugin copying into a docker instance works perfect to a standard remote docker machine with following configuration:

docker {
    url = 'https://IP:2376'
    certPath = new File('/Users/USER/.docker/machine/machines/MACHINE')
}

I need to do the same with IBM Containers service. This service supports standard docker command. I just need to do:

export DOCKER_HOST=tcp://containers-api.eu-gb.bluemix.net:8443
export DOCKER_CERT_PATH=/Users/USER/.ice/certs
export DOCKER_TLS_VERIFY=1

And any docker command works with IBM Containers service, but not the gradle task that was previously working. If I put this parameters (both with tcp:// or https:// in host url parameter) and also I execute the IBM Containers exports when I execute gradle I get:

:copyBootJarsToDocker FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':copyBootJarsToDocker'.
> <html>
  <head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
  <body bgcolor="white">
  <center><h1>400 Bad Request</h1></center>
  <center>The plain HTTP request was sent to HTTPS port</center>
  <hr><center>nginx</center>
  </body>
  </html>

Is there anyway to configure this plugin to make it work with IBM Containers docker service so I can automate my application updates?

thanks

1

There are 1 answers

0
Daniel Berg On

I don't know the gradle plugin but I verified that if you export the Docker properties that you have specified (also found running 'cf ic init') then the following command works perfectly fine against the IBM Container service.

docker cp some-file.txt my-container:temp/some-file.txt

This demonstrates that the IBM Container service is respecting the Docker remote API.

I am not sure why you have used "https" for the docker url. Have you tried using the exact URL expected for the DOCKER_HOST? Specifically use tcp://containers-api.eu-gb.bluemix.net:8443