我正在运行Windows的Docker并尝试构建映像。效果很好,但是后来我将其添加到了Dockerfile的末尾:
# Install Python
RUN choco install -y python3 --params "/InstallDir:C:\Python"
ENV PYTHONPATH=C:\Python\python.exe
这样做的时候,图像就生成了,但是当我尝试运行它时,我得到了:
C:\ Program Files \ Docker \ Docker \ Resources \ bin \ docker.exe:错误 守护程序的响应:容器 9e758f7ef343436f64e7e29b795154b1e771a6682b625097d680e3b510a9047c Windows系统调用中的开始:失败期间遇到错误: 计算系统意外退出。 (0xc0370106)。
因此,我删除了两行并进行了重建。但是,当我尝试运行它(现在已还原为以前可以使用的版本!)时,仍然出现错误。我如何清除所有混乱情况?到目前为止,我已经尝试了以下方法:
docker rmi -f
,并且任何看起来像某种中间形式的图像都没有标签。docker system prune
--no-cache
--memory=8G
来提供构建和运行更多的内存此外,请注意该映像(完整映像,包括安装Python的代码行)将在我运行Windows Server 2016的另一台计算机上构建并运行。因此,该映像很好。这台计算机上有些东西我似乎无法撤消。我想除非有人有更好的主意,否则下一步是重新安装Docker。
Docker Verison:
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:21:34 2018
OS/Arch: windows/amd64
Experimental: false
Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.24)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:36:40 2018
OS/Arch: windows/amd64
Experimental: false
整个Dockerfile:
# escape=`
FROM microsoft/dotnet-framework:4.7.1 as vsbuild
# Restore the default Windows shell for correct batch processing below.
SHELL ["cmd", "/S", "/C"]
# Download the Build Tools bootstrapper
ADD https://aka.ms/vs/15/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe
# Install Static Analysis Tools
RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
--add Microsoft.VisualStudio.Component.Static.Analysis.Tools `
|| IF "%ERRORLEVEL%"=="3010" EXIT 0
FROM jetbrains/teamcity-agent:2018.1.2-windowsservercore-ltsc2016
COPY --from=vsbuild ["C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/Team Tools", "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/Team Tools"]
COPY --from=vsbuild ["C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/MSBuild/Microsoft/VisualStudio/v15.0/CodeAnalysis", "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/MSBuild/Microsoft/VisualStudio/v15.0/CodeAnalysis"]
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# Install Chocolatey
ADD https://chocolatey.org/install.ps1 C:\TEMP\chocolatey.ps1
RUN C:\TEMP\chocolatey.ps1
# Install Node.js
RUN choco install -y nodejs
# Install Gulp
RUN choco install -y gulp-cli
# Install SQL Command Line Utilities
RUN choco install -y sqlserver-cmdlineutils
# Install Azure Powershell
RUN choco install -y azurepowershell
# Install Web Deploy 3.0
RUN choco install -y msdeploy3
# Install WAWSDeploy
RUN choco install -y wawsdeploy
# Install Python
#RUN choco install -y python3 --params "/InstallDir:C:\Python"
#ENV PYTHONPATH=C:\Python\python.exe