Quick Fix
Search your solution for any references to the Docker image tag mcr.microsoft.com/dotnet/framework/sdk:4.8
and replace them with mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
.
Explanation
Many of the examples provided by Sitecore use .NET Framework SDK images provided by Microsoft as a base for solution builds. When the Microsoft image tags do not contain an OS version, they are often actually references to a manifest associated with the tag to determine the actual image that will be used, based on the OS version of the Docker host.
You can see the available OS images associated with a manifest with the docker manifest inspect
command.
docker manifest inspect mcr.microsoft.com/dotnet/framework/sdk:4.8
If Microsoft does not have an SDK image for your exact Windows version (perhaps you are using a new or old SAC release), you may end up with LTSC2016, which does not have TLS 1.2 enabled, thus the TLS error downloading NuGet.exe
.
You can see the Windows version of the image actually being used in your Docker host via docker image inspect
.
docker image inspect mcr.microsoft.com/dotnet/framework/sdk:4.8 --format '{{ .OsVersion }}'
10.0.14393.4402
In the output above, 10.0.14393
would indeed indicate use of LTSC2016.