title: Multi-Stage Dockerfile Build Fails to COPY Program Files - Access is denied
body: <p>I am creating a windows docker container that will be used to perform some administrative tasks that require <a href="https://www.microsoft.com/en-us/download/details.aspx?id=53591" rel="nofollow noreferrer">SQL Server Command Line Utilities</a> to be installed. My goal is to use a multi-stage build to ensure MSI/chocolatey installation cruft is not included in the final image.  When I execute a <code>docker build</code> I get this error:</p>
  
  <pre><code>Step 8/10 : COPY --from=setup ["C:\\Program Files\\Microsoft SQL Server" "C:\\Program Files\\Microsoft SQL Server"]
  failed to create hash for Documents and Settings: readlink \\?\Volume{b9e10f4e-aa64-4233-a798-28aa8ac73055}\Documents and Settings: Access is denied.
  </code></pre>
  
  <p>Is it possible to copy files from <code>Program Files</code> in this way?  How might one get this to work?</p>
  
  <p>Here is my Dockerfile:</p>
  
  <pre><code># Setup container installs chocolatey and sqlserver CLI tools
  FROM microsoft/windowsservercore:latest as setup
  SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
  
  RUN Invoke-WebRequest -OutFile chocoinstall.ps1 "https://chocolatey.org/install.ps1"
  RUN . .\chocoinstall.ps1
  RUN choco install 'sqlserver-cmdlineutils' -version '13.1' --yes
  
  # Deploy Tools image
  FROM microsoft/windowsservercore:latest
  SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
  
  # SQL server CLI tools
  COPY --from=setup ["C:\\Program Files\\Microsoft SQL Server" "C:\\Program Files\\Microsoft SQL Server"]
  RUN $env:PATH = 'C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\130\\Tools\\Binn\\;' + $env:PATH;
  
  ENTRYPOINT ["powershell"]
  </code></pre>