Home » Java » IntelliJ docker deployment ADD: no such file or directory

IntelliJ docker deployment ADD: no such file or directory

Posted by: admin October 26, 2017 Leave a comment

Questions:

I installed the docker integration plugin for IntelliJ to deploy instantly a project.
Currenty I’m working on a project with gradle. There the strucure looks like:

project  
|- build/
|-- docker/
|--- Dockerfile
|--- target/
|---- myApp.jar
|- docker/
|-- Dockerfile
|- src/
|-- de.myApp/
|--- SOURCECODE
|- build.gradle
|- gradlew

In my Dockerfile I add the .jar with:
ADD target/data_sample_set_structure_consumer-0.0.0.jar app.jar

The deployment configuration uses Deployment: docker/Dockerfile.

When I click on start, I get the following error message:

Step 3/4 : ADD target/data_sample_set_structure_consumer-0.0.0.jar app.jar

Error: ResponseItem.ErrorDetail[code=<null>,message=ADD failed: stat /var/lib/docker/tmp/docker-builder981429297/target/data_sample_set_structure_consumer-0.0.0.jar: no such file or directory]
Failed to deploy '<unknown>  Dockerfile: docker/Dockerfile': ADD failed: stat /var/lib/docker/tmp/docker-builder981429297/target/data_sample_set_structure_consumer-0.0.0.jar: no such file or directory

But if I build the Dockerfile with ./gradlew buildDocker everything is fine.

PS:
I checked this without effort.

Answers: