【发布时间】:2020-04-10 04:21:44
【问题描述】:
我有一个 Windows Server 2016 Docker 容器,我想将a specific KB update 应用到它。我想知道如何以编程方式做到这一点?
【问题讨论】:
标签: windows containers windows-server windows-server-2016 windows-container
我有一个 Windows Server 2016 Docker 容器,我想将a specific KB update 应用到它。我想知道如何以编程方式做到这一点?
【问题讨论】:
标签: windows containers windows-server windows-server-2016 windows-container
您的 Dockerfile 可能如下所示:
FROM microsoft/windowsservercore:ltsc2016
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Invoke-WebRequest "KB_URL" -OutFile update.exe -UseBasicParsing ; \
Start-Process -FilePath 'update.exe' -ArgumentList '--quiet', '--norestart' -Wait ; \
Remove-Item .\update.exe
【讨论】: