1

Installing windows-sdk-10-version-2004-all using chocolatey in docker with Dockerfile

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 )

It fails complaining

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.

Details of the error says:

[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

This was running some weeks ago.

Is it possible to fix this check or ignoring it ?

7
  • It's a hash mismatch issue per the error for package_WPTx64_x86_en_us. Try running Dism /Online /Cleanup-Image /StartComponentCleanup, then try the install again. If it fails again, it's either a download issue, an issue with chocolately, or the server contains a corrupted package_WPTx64_x86_en_us package (if it's the latter, it has to be fixed on Microsoft's end). To rule out chocolately, try the install via the SDK installer directly, which also supports a cli install.
    – JW0914
    Commented Jan 3, 2021 at 15:19
  • @JW0914: installation on my PC works well, but it fails building docker image. Adding ` dism /Online /Cleanup-Image /StartComponentCleanup` also fails. Maybe link to the building plateform ?
    – mpromonet
    Commented Jan 3, 2021 at 16:39
  • I have no experience with docker, but am curious what error Dism returned
    – JW0914
    Commented Jan 3, 2021 at 17:44
  • @JW0914 the error is not with dism, after executing it successfully, the choco install fails the same.
    – mpromonet
    Commented Jan 8, 2021 at 22:21
  • @JW0914: today the exact same docker build works, maybe packages changes....
    – mpromonet
    Commented Jan 8, 2021 at 22:31

0

You must log in to answer this question.

Browse other questions tagged .