title: Docker build fails on COPY or ADD statement for entrypoint, Windows only
body: <p>I'm creating an entrypoint for a Docker container, and then attempting to run it using a <code>docker-compose.yml</code> file.  <strong>This works just fine in Ubuntu and OS X</strong>, but I get a permissions error (without much additional information) in Windows</p>
  
  <p>Here is the Dockerfile:</p>
  
  <pre><code>FROM node:6.9
  
  MAINTAINER Some Dude &lt;dude@dude.com&gt;
  
  WORKDIR /opt
  
  # Install Compass
  RUN DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade
  RUN apt-get -y update
  RUN apt-get -y install gcc rubygems ruby-dev
  RUN gem update --system
  RUN gem install compass
  
  # Install Compass Extensions
  RUN gem install compass-blend-modes compass-import-once
  
  # Install glup globally
  RUN npm install -g gulp
  
  # Copy the setup file
  COPY setup/gulp/docker-gulp-setup.sh /usr/local/bin/docker-gulp-setup.sh
  RUN chmod +x /usr/local/bin/docker-gulp-setup.sh
  
  CMD ['gulp']
  </code></pre>
  
  <p>Here is the docker-compose.yml entry:</p>
  
  <pre><code>version: '2'
  
  services:
  
          mycontainer-for-gulp:
                  build:
                          context: .
                          dockerfile: Dockerfile.gulp
                  volumes:
                          - ./:/opt:Z
                  command: /usr/local/bin/docker-gulp-setup.sh
  </code></pre>
  
  <p>Here is the output when the build command is run on Windows:</p>
  
  <pre><code>λ docker-compose build mycontainer-for-gulp
  Building mycontainer-for-gulp
  Traceback (most recent call last):
   File "&lt;string&gt;", line 3, in &lt;module&gt;
   File "compose\cli\main.py", line 65, in main
   File "compose\cli\main.py", line 117, in perform_command
   File "compose\cli\main.py", line 223, in build
   File "compose\project.py", line 300, in build
   File "compose\service.py", line 742, in build
   File "site-packages\docker\api\build.py", line 55, in build
   File "site-packages\docker\utils\utils.py", line 95, in tar
   File "tarfile.py", line 2023, in add
   File "tarfile.py", line 2052, in addfile
   File "tarfile.py", line 278, in copyfileobj
  IOError: [Errno 13] Permission denied
  docker-compose returned -1
  </code></pre>
  
  <p>Note that it IS the <code>COPY</code> command that's generating the error, because we tried commenting out both that and the <code>RUN chmod</code> statement individually.</p>
  
  <p>When I run a raw docker build query:</p>
  
  <pre><code>docker build -f Dockerfile.gulp .
  </code></pre>
  
  <p>Then I get a bunch of error output as it tries to tar up the current directory.  Basically every file add fails.  Full output is here:</p>
  
  <p><a href="https://gist.github.com/danieltalsky/4cb6bddb6534c46b051230bc45578072" rel="noreferrer">https://gist.github.com/danieltalsky/4cb6bddb6534c46b051230bc45578072</a></p>