系统规格:
操作系统:Windows 10 Professional v1803
Docker桌面社区
版本2.0.0.3(31259)
频道:稳定
内部版本:8885db3
Dockerfile:
FROM microsoft/windowsservercore
SHELL ["powershell"]
# Note: Get MSBuild 12.
RUN Invoke-WebRequest "https://download.microsoft.com/download/9/B/B/9BB1309E-1A8F-4A47-A6C5-ECF76672A3B3/BuildTools_Full.exe" -OutFile "$env:TEMP\BuildTools_Full.exe" -UseBasicParsing
RUN & "$env:TEMP\BuildTools_Full.exe" /Silent /Full
# Todo: delete the BuildTools_Full.exe file in this layer
# Note: Add .NET + ASP.NET
RUN Install-WindowsFeature NET-Framework-45-ASPNET ; \
Install-WindowsFeature Web-Asp-Net45
# Note: Add NuGet
RUN Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -OutFile "C:\windows\nuget.exe" -UseBasicParsing
WORKDIR "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0"
# Note: Install Web Targets
RUN & "C:\windows\nuget.exe" Install MSBuild.Microsoft.VisualStudio.Web.targets -Version 12.0.4
RUN mv 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\MSBuild.Microsoft.VisualStudio.Web.targets.12.0.4\tools\VSToolsPath\*' 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\'
# Note: Add Msbuild to path
RUN setx PATH '%PATH%;C:\\Program Files (x86)\\MSBuild\\12.0\\Bin\\msbuild.exe'
CMD ["C:\\Program Files (x86)\\MSBuild\\12.0\\Bin\\msbuild.exe"]
要构建docker映像:
docker build -t msbuild_windows_docker .
错误消息:
将构建上下文发送到Docker守护程序3.072kB 第1/11步:通过microsoft / windowsservercore 最新:从microsoft / windowsservercore中提取 3889bb8d808b:提取[============================================= ====>] 4.07GB / 4.07GB d0c71fc8924e:下载完成 无法注册图层:重新执行错误:退出状态1:输出:失败到safefile.OpenRelative在Win32中失败:打开\?\ C:\ ProgramData \ Docker \ windowsfilter \ a5f79af601e43eb678a8bfc03138e656441d9c074e29d71a863e24670682456e \ Files \ Windows \ Windows \ WinSxS \ x86_microsoft s..ccessagent-binaries_31bf3856ad364e35_10.0.14393.0_none_af862ecfd2b5fd38 \ autorun.inf:访问被拒绝。 (0x1f)文件\ Windows \ WinSxS \ x86_microsoft-windows-s..ccessagent-binaries_31bf3856ad364e35_10.0.14393.0_none_af862ecfd2b5fd38 \ autorun.inf PS E:\ Projects \ Dockerised Apps \ Msbuild_Image> docker build -t msbuild_windows_docker。 将构建上下文发送到Docker守护程序3.072kB 第1/11步:通过microsoft / windowsservercore 最新:从microsoft / windowsservercore中提取 3889bb8d808b:提取[============================================= ====>] 4.07GB / 4.07GB d0c71fc8924e:下载完成 无法注册层:重新执行错误:退出状态1:输出:失败到safefile.OpenRelative在Win32中失败:打开\?\ C:\ ProgramData \ Docker \ windowsfilter \ 5f23c6070401a0a671eee3b636184b9808fa724c9826efb23cdb11e6fb6c9ce1 \ Files \ Windows \ WinSxS s..ccessagent-binaries_31bf3856ad364e35_10.0.14393.0_none_af862ecfd2b5fd38 \ autorun.inf:访问被拒绝。 (0x1f)文件\ Windows \ WinSxS \ x86_microsoft-windows-s..ccessagent-binaries_31bf3856ad364e35_10.0.14393.0_none_af862ecfd2b5fd38 \ autorun.inf
请求:
我对Docker并不陌生,我正在做个人项目以使用Windows容器来构建Visual Studio解决方案。不确定为什么我无法构建docker映像吗?即使我在计算机上拥有管理权限。请为此提供一些反馈。谢谢。