我在 docker RUN 中看到了很多有关退出代码“3221225781”的问题,但我仍然找不到答案。考虑这个 dockerfile:
FROM mcr.microsoft.com/dotnet/core/runtime:3.1
WORKDIR /app
ADD https://aka.ms/vs/16/release/vc_redist.x64.exe vc_redist.x64.exe
RUN VC_redist.x64.exe /install /quiet /norestart /log vc_redist.log
运行此程序时,我得到以下输出:
C:\test>docker image build -t exitcodetest:1.0 .
Sending build context to Docker daemon 113.2MB
Step 1/4 : FROM mcr.microsoft.com/dotnet/core/runtime:3.1
---> 3be5e0b7f3a5
Step 2/4 : WORKDIR /app
---> Using cache
---> 4508bead23e2
Step 3/4 : ADD https://aka.ms/vs/16/release/vc_redist.x64.exe vc_redist.x64.exe
Downloading [==================================================>] 15.06MB/15.06MB
---> 37322d63b677
Step 4/4 : RUN VC_redist.x64.exe /install /quiet /norestart /log vc_redist.log
---> Running in c57b67befa33
The command 'cmd /S /C VC_redist.x64.exe /install /quiet /norestart /log vc_redist.log' returned a non-zero code: 3221225781
为什么我会得到这个退出代码?这是什么意思?我还确认没有写入 vc_redist.log。
有人知道我能做些什么来让它发挥作用吗?
我应该补充一点,当我在本地计算机上运行该命令时,该命令可以工作,并返回零%ERRORLEVEL%。
Thanks!
我想我已经明白了这一点。看起来图像“mcr.microsoft.com/dotnet/core/runtime:3.1.1”只是一个“层”,它只包含安装运行时所需的配方,但不包含底层操作系统规范(请如果这是错误的,请纠正我)。因此,我首先需要提供操作系统并安装到该操作系统,然后应用 .NET Core 运行时。这似乎有效:
FROM mcr.microsoft.com/windows/servercore:ltsc2019
WORKDIR /app
ADD https://aka.ms/vs/16/release/vc_redist.x64.exe vc_redist.x64.exe
RUN VC_redist.x64.exe /install /quiet /norestart /log vc_redist.log
FROM mcr.microsoft.com/dotnet/core/runtime:3.1.1
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)