I'm trying to run spring boot sample on osx (mbp) and I'm getting following exception (Trying buildDocker task). I'm sure I have configured docker properly as I can run command docker-machine run hello-world
and receive proper output.
Caused by: java.io.FileNotFoundException: /src/main/docker/Dockerfile (No such file or directory)
at se.transmode.gradle.plugins.docker.image.Dockerfile.fromExternalFile(Dockerfile.groovy:45)
at se.transmode.gradle.plugins.docker.image.Dockerfile$fromExternalFile.call(Unknown Source)
at se.transmode.gradle.plugins.docker.DockerTask.buildDockerfile(DockerTask.groovy:223)
at se.transmode.gradle.plugins.docker.DockerTask.build(DockerTask.groovy:238)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
... 54 more
Other validation would be I can run gradle-docker default build task (i.e. distDocker) without any problem. Problem occur when I try to run build following build task on the gradle script.
// tag::task[]
task buildDocker(type: Docker, dependsOn: build) {
push = true
applicationName = jar.baseName
dockerfile = file('/src/main/docker/Dockerfile')
doFirst {
copy {
from jar
into stageDir
}
}
}
// end::task[]
I can't workout why it cannot determine the file when it's already exists. I tried copying into root and change path for no luck.
OSX : 10.10.4 Java : 1.8
Remove the '/' before src in the path. The path is relative from the current directory (project root) and not the volume root.