title: Dockerfile: Copy directory from Windows host to docker container
body: <p>I want to build a Docker image including my custom Powershell modules. Therefore I use Microsofts <code>microsoft/powershell:latest</code> image, from where I wanted to create my own image, that includes my psm1 files.</p>
  
  <p>For simple testing I've the following docker file:</p>
  
  <pre><code>FROM microsoft/powershell:latest
  RUN mkdir -p /tmp/powershell
  COPY  C:/temp/somedirectory /tmp/powershell
  </code></pre>
  
  <p>I want to copy the files included in C:\temp\somedirectory to the docker linux container. When building the image I get the following error:</p>
  
  <blockquote>
    <p>C:\temp\docker_posh> docker build --rm -f Dockerfile -t docker_posh:latest .</p>
    
    <p>Sending build context to Docker daemon  2.048kB</p>
    
    <p>Step 1/3 : FROM microsoft/powershell:latest
     ---> 9654a0b66645</p>
    
    <p>Step 2/3 : RUN mkdir -p /tmp/powershell
     ---> Using cache
     ---> 799972c0dde5</p>
    
    <p>Step 3/3 : COPY  C:/temp/somedirectory /tmp/powershell
    COPY failed: stat /var/lib/docker/tmp/docker-builder566832559/C:/temp/somedirectory: no such file or directory</p>
  </blockquote>
  
  <p>Of course I know that Docker says that I can't find the file/directory. Therefore I also tried <code>C:/temp/somedirectory/.</code>, <code>C:/temp/somedirectory/*</code>, and <code>C:\\temp\\somedirectory\\</code> as alternativ source paths in the Dockerfile -> Result: none of them worked.</p>
  
  <pre><code>docker version
      Client:
         Version:       17.12.0-ce
         API version:   1.35
         Go version:    go1.9.2
         Git commit:    c97c6d6
         Built: Wed Dec 27 20:05:22 2017
         OS/Arch:       windows/amd64
  
      Server:
         Engine:
         Version:      17.12.0-ce
         API version:  1.35 (minimum version 1.12)
         Go version:   go1.9.2
         Git commit:   c97c6d6
         Built:        Wed Dec 27 20:12:29 2017
         OS/Arch:      linux/amd64
         Experimental: true
  </code></pre>
  
  <p>How can I copy a folder including subfolder and files via a Dockerfile?</p>