Q:

Docker multistage on windows COPY c:\windows not allowed

I am trying to install the vsbuildtools in a docker container for windows. Unfortunately, even with the installPath the installer installs stuff everywhere.
I, therefore, have to do
Step 27/32 : COPY --from=SetupPhase C:\Windows C:\Windows

but it gives me this error:
docker : COPY failed: copy from c:\ or c:\windows is not allowed on
windows At line:1 char:1
+ docker build -m 2GB -t monamimani/msbuild .
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (COPY failed: co...owed on windows:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError   Command executed with exception: COPY failed: copy from c:\ or c:\windows is not allowed on windows

Is there a way to solve this?

A:

I found a workaround, where this doesn't work
COPY --from=SetupPhase ["C:\\Windows", "C:\\Windows"]

but this works
COPY --from=SetupPhase ["C:\\Windows\\assembly", "C:\\Windows\\assembly"]

So I just need to run a copy operation for each subfolder of c:\windows that I want to copy.

