You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
task buildDocker(type: Docker, dependsOn: build) {
push = false
dockerfile = file("Dockerfile")
version release.version
tag = "${docker_registry_url}/camunda"
doFirst {
copy {
from war
into stageDir
}
copy {
from "${projectDir}/camunda/"
into stageDir
}
copy {
from "${projectDir}/definitions/"
into stageDir
}
}
}
Output
./gradlew clean build buildDocker --info
Execution failed for task ':buildDocker'. Docker execution failed Command line [docker build -t 73299472920.dkr.ecr.us-east-1.amazonaws.com/camunda:0.0.0.uncommitted-71119c2 /Users/amx/Code/backend/jclaim/build/docker] returned:
COPY failed: no source files were specified
I am able to build this image manually from the same Dockerfile using docker build -t but somehow it fails in Gradle buildDocker task.
It even works when I do not add the last two COPY
Dockerfile
FROM camunda/camunda-bpm-platform:tomcat-7.7.0
COPY build/libs/*.war /camunda/webapps/
But I have to COPY the other two artifacts as well.
My Docker plugin for Docker:
se.transmode.gradle:gradle-docker:1.2
Gradle Version:
Gradle 5.1.1
Please help me fix this.
The text was updated successfully, but these errors were encountered:
Best guess is that the files you are trying to copy is not available at the time the docker command is executed. Take a look at the build/docker folder (docker build command is ran using this folder).
Perhaps you can perform the copy closures in a separate tasks the the buildDocker task depend on. Might work
The plugin uses a "staging dir" which is then the directory the docker command is run within. So the cause for the error you see is that the current work directory is not what you expect.
I am new to Gradle. I am trying to build a Dockerfile from within my build.gradle
Dockerfile
build.gradle
Output
./gradlew clean build buildDocker --info
I am able to build this image manually from the same Dockerfile using docker build -t but somehow it fails in Gradle buildDocker task.
It even works when I do not add the last two COPY
Dockerfile
But I have to COPY the other two artifacts as well.
My Docker plugin for Docker:
se.transmode.gradle:gradle-docker:1.2
Gradle Version:
Gradle 5.1.1
Please help me fix this.
The text was updated successfully, but these errors were encountered: