在Windows上的多克斯多级COPY C:\窗户不允许

我正在尝试在一个docker容器中安装vsbuildtools for windows。 不幸的是,即使安装了installPath,安装程序也随处安装。

因此,我必须这样做

Step 27/32 : COPY --from=SetupPhase C:\Windows C:\Windows 

但它给了我这个错误:

 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 

有没有办法解决这个问题?

我发现一个解决方法,在这不起作用

 COPY --from=SetupPhase ["C:\\Windows", "C:\\Windows"] 

但是这个工作

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

所以我只需要为我想要复制的c:\ windows的每个子文件夹运行一个复制操作。

通过尝试另一个path来检查这是否是一个权限问题,仅用于testing。

但是也要考虑“ Windows上的Dockerfile ”,它为COPY命令指定:

Windows注意事项

在Windows上,目标格式必须使用正斜杠
例如,这些是有效的COPY指令。

 COPY test1.txt /temp/ COPY test1.txt c:/temp/ 

但是,以下将无法正常工作。

 COPY test1.txt c:\temp\ 
Interesting Posts