gradle-docker
gradle-docker copied to clipboard
COPY breaks due to DockerFile being copied to build/docker dir
if your Dockerfile is in the root of a project, this task moves it to build/docker which breaks all source paths specified in one's docker file....
You can use gradle's copy to create a task to be run as a dependency of the main task to copy your dependant files into the build directory, as a workaround.
I ran into this issue as well, and used this as the solution.
I just switched this https://github.com/bmuschko/gradle-docker-plugin/
problems solved
Adding on to the workaround suggested by @sanimalp, below snippet is an example. Note: In this case, all dependent files are placed to docker directory, and initBuildContext task copies its contents to build/docker directory.
task initBuildContext(type: Copy) {
from 'docker'
into 'build/docker'
}
distDocker {
dockerfile = 'Dockerfile'
}
distDocker.dependsOn 'initBuildContext'