I want to create a docker image. This is my work directory: Dockerfile.in test.json test.py
And this is my Dockerfile:
COPY ./test.json /home/tes
In my case, I had to put all my project files into a subdirectory
app -|inside app directory we have the following
| package.js
| src
| assets
Dockerfile
Then I copied files in his way
COPY app ./
I had to use the following command to start the build:
docker build .
When using the Docker compose files, publish, publishes to obj/Docker/Publish. When I copied my files there and pointed my Dockerfile to this directory (as generated), it works…
In your case removing ./ should solve the issue. I had another case wherein I was using a directory from the parent directory and docker can only access files present below the directory where Dockerfile is present so if I have a directory structure /root/dir and Dockerfile /root/dir/Dockerfile
I cannot copy do the following
COPY root/src /opt/src
You should put those files into the same directory with Dockerfile.
I was also facing the same, I moved my docker file to root of the project. then it worked