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:
Using COPY --from=builder ["", ""] as suggested as a temporary workaround for a bug here. It's probably not this bug because I'm using Docker Engine 19.03.2, which fixed the issue.
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:
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