for-win icon indicating copy to clipboard operation
for-win copied to clipboard

COPY command in Docker Build fails with Windows Containers

Open ldario opened this issue 7 years ago • 2 comments

  • [X] I have tried with the latest version of my channel (Stable or Edge)
  • [X] I have uploaded Diagnostics
  • Diagnostics ID: D2A5C919-E47A-417E-A52C-AB54A88C85F6/20190911172646

Expected behavior

Running docker build -t buildtools2017native:latest -m 2GB . should successfully build the example Windows Image, properly copying "Install.bat" into the Windows Container.

Actual behavior

Docker build fails at step 4:

PS D:\Projects\scrap\dockerTest\vs-dockerfiles-master\native-desktop> docker build -t buildtools2017native:latest -m 2GB .
Sending build context to Docker daemon  6.656kB
Step 1/13 : ARG FROM_IMAGE=microsoft/dotnet-framework:3.5-sdk-windowsservercore-1709
Step 2/13 : FROM ${FROM_IMAGE}
 ---> 9b230679c80b
Step 3/13 : SHELL ["cmd", "/S", "/C"]
 ---> Using cache
 ---> 4192e04fb659
Step 4/13 : COPY Install.cmd C:\TEMP\
failed to copy files: failed to copy file: chtimes \\?\Volume{e6e12635-3ece-46fb-b20a-7df1212c128f}\TEMP\Install.cmd: The system cannot find the file specified.

Information

I am using Docker for Windows, and tried to build an example of creating a Windows container that has Visual Studio build tools using this tutorial. I pulled down the repository referenced in the tutorial, changed directory into the "native-desktop" folder and ran "docker build -t buildtools2017native:latest -m 2GB ." in powershell.

This issue is repeatable on my machine. I also tried following this tutorial here, and I get the same error when the ADD command is called in the example Dockerfile.

I don't seem to have this problem when building Linux containers that have dockerfiles that use the ADD command, so I think it's a Windows container issue.

I've tried looking through other bug reports that seem similar and tried some of those fixes, but they didn't work. I tried:

I'm new to using docker, so I wouldn't be surprised if I just setup something wrong. I'm lost at this point, any help figuring this out would be greatly appreciated. Thanks in advance!

  • Windows Version: Windows 10 Enterprise 1709
  • Docker Desktop Version: Docker Desktop Community for Windows 2.1.0.2 (37877)
  • Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM:

Steps to reproduce the behavior

Followed directions here

  1. Downloaded zip of repository, extracted into folder in the D Drive.
  2. Started docker, made sure docker is using windows containers
  3. Open powershell, cd into "native-deskop" folder
  4. Run docker build -t buildtools2017native:latest -m 2GB .

ldario avatar Sep 11 '19 18:09 ldario

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

docker-robott avatar Dec 10 '19 01:12 docker-robott

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked

docker-robott avatar Jul 10 '20 03:07 docker-robott