Dockerfile ADD failed : No Source files were specified
It generally is recommended to use COPY
before ADD
, because it serves a lesser purpose and is somewhat more lightweight.
To copy your whole directory into the image, just add the following line after editing:
COPY . /path/to/dir/in/image
Some helpful links to start writing dockerfiles:
Reference
Best Practices
Postgresql example
I had the same error message.
It was a .dockerignore
next to my Dockerfile wich was ignoring my file.
In a Java project, the problem was the lack of a JAR file in the target folder. It was necessary to make (in the case of maven) the mvn clean package, and then make the docker run command.