0

I am trying to build a Dockerfile image and I am getting an error in the part of COPY command.

The error is

no such file or directory

The code are as below

...
COPY ../../Folder/file1.txt .
COPY ../../Folder/file2.txt .
...
  • Use the ancestor directory as the directory argument to `docker build`; use a `docker build -f` option to point at the Dockerfile, if you don't also move it to that ancestor directory; and make the `COPY` paths relative to that ancestor directory. Leading `..` on the left-hand side of `COPY` just get dropped. The linked question has a couple of examples. – David Maze Sep 18 '22 at 10:50
  • Found a solution so the / is very important in the last part of the COPY command. It should be COPY ../../Folder/file1.txt ./ – CodeBreaker Sep 19 '22 at 07:55

0 Answers0