Chocolatey installs locally but not in a docker build (but it did last week) - Why? Chocolatey installs locally but not in a docker build (but it did last week) - Why? docker docker

Chocolatey installs locally but not in a docker build (but it did last week) - Why?


There have been a few issues from TLS changes to changes to the microsoft base images that have caused me some problems with 7zip and choco over the last 3 weeks. I've got my base images working now by adding the following:

RUN $text = '[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13 -bor [Net.SecurityProtocolType]::Tls12 -bor [Net.SecurityProtocolType]::Ssl3 -bor [Net.SecurityProtocolType]::Tls'; \    $text | Set-Content 'C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1';RUN powershell -Command Set-ExecutionPolicy Bypass -Scope Process -Force; \    iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); \    powershell -Command refreshenv; \    cinst -y --allow-empty-checksums 7zip.install make nuget.commandline --no-progress;

However I am still experiencing some issue in other images with the reported error: "7-Zip signalled an unknown error (code -1073741511)", however no doubt they boil down to the same thing. Again, if I exec in to the running container, I am able to manually run choco and install 7zip and even access the "7z" commands. I tried committing the container once I made the changes, but still got this issue.