1

So, I am new to Docker but after trying a couple of times I can't get this to work.

Basically I have a simple script like this:

Dockerfile

from centos:7
.....
COPY /C:/Users/Kalin/Drive/web/sites/foo.com/ /var/www
EXPOSE 80

Whenever I run docker build everything works as planned except at the COPY part I get this error:

Step 10/11 : COPY /C:/Users/Kalin/Drive/web/sites/foo.com/ /var/www
COPY failed: stat /var/lib/docker/tmp/docker-builder646917435/C:/Users/Kalin/Drive/web/Kalin/foo.com: no such file or directory

I get the error is about not finding a directory, but instead of looking for it starting from C:/.. foldedr it is looking from /var/...

I don't know what mistake I am doing

entegra
  • 305
  • 1
  • 3
  • 9
  • 1
    Possible duplicate of [Dockerfile COPY from a Windows file system to a docker container](https://stackoverflow.com/questions/46309423/dockerfile-copy-from-a-windows-file-system-to-a-docker-container) – far Sep 11 '18 at 18:02
  • For the source path, you need to use a relative path from the directory you're currently in. – far Sep 11 '18 at 18:03

1 Answers1

1

I would strongly suggest to make relative path in COPY command so if you have your docker file in /C:/Users/Kalin and you are running docker build from that folder, just place Drive/web/sites/foo.com/ in COPY command

Jakub Bujny
  • 4,400
  • 13
  • 27