使用 Dockerfile 在 docker 中使用 chocolatey 安装 windows-sdk-10-version-2004-all
FROM mcr.microsoft.com/windows/servercore:ltsc2019
RUN powershell.exe -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SETX PATH "%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
RUN choco install --no-progress -y windows-sdk-10-version-2004-all || ( type %ProgramData%\chocolatey\logs\chocolatey.log && type %TMP%\chocolatey\*.log )
抱怨无济于事
Hashes match.
Installing windows-sdk-10-version-2004-all...
ERROR: Running ["C:\Users\ContainerAdministrator\AppData\Local\Temp\chocolatey\windows-sdk-10-version-2004-all\10.0.19041.0\winsdksetup.exe" /Features + /Quiet /NoRestart /Log "C:\Users\ContainerAdministrator\AppData\Local\Temp\chocolatey\windows-sdk-10-version-2004-all_7076271d-d332-420d-94b9-c752a03907a4.log" ] was not successful. Exit code was '-2146889721'. See log for possible error messages.
错误详细信息如下:
[059C:08D4][2021-01-03T14:39:53]w343: Prompt for source of package: package_WPTx64_x86_en_us, payload: package_WPTx64_x86_en_us, path: C:\Users\ContainerAdministrator\AppData\Local\Temp\chocolatey\windows-sdk-10-version-2004-all\10.0.19041.0\Installers\WPTx64-x86_en-us.msi
[059C:08D4][2021-01-03T14:39:53]i000: package_WPTx64_x86_en_us
[059C:08D4][2021-01-03T14:39:53]i000: Resolving download root for: http://go.microsoft.com/fwlink/?prd=11966&pver=1.0&plcid=0x409&clcid=0x409&ar=Windows10&sar=SDK&o1=10.0.19041.1
[059C:08D4][2021-01-03T14:39:53]i000: HTTP status code: 302
[059C:08D4][2021-01-03T14:39:53]i000: Redirected URL: https://www.microsoft.com?ref=go
[059C:08D4][2021-01-03T14:39:53]i000: Resolved redirected download root: https://www.microsoft.com?ref=go/
[059C:08D4][2021-01-03T14:39:53]i000: package_WPTx64_x86_en_us to https://www.microsoft.com/Installers/WPTx64-x86_en-us.msi
[059C:08D4][2021-01-03T14:39:53]i338: Acquiring package: package_WPTx64_x86_en_us, payload: package_WPTx64_x86_en_us, download from: https://www.microsoft.com/Installers/WPTx64-x86_en-us.msi
[082C:08B0][2021-01-03T14:39:53]e000: Error 0x80091007: Hash mismatch for path: C:\ProgramData\Package Cache\.unverified\package_WPTx64_x86_en_us, expected: 3F73CF1FD812D8877E1B9131E02D9ECBAA9EC773, actual: F21BF2F13F89D1C9DFD2844D57728102D5714EAA
这是几周前开始的。
是否有可能修复这个检查或者忽略它?