When I try to run dotnet restore as a RUN instruction of a Dockerfile while building it, I get the following errors:
/src/Anonymized.Tests/Anonymized.Tests.csproj : error NU3028: Package 'Microsoft.Win32.SystemEvents 5.0.0' from source 'https://api.nuget.org/v3/index.json': The author primary signature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain [/src/Anonymized.sln]
/src/Anonymized.Tests/Anonymized.Tests.csproj : error NU3037: Package 'Microsoft.Win32.SystemEvents 5.0.0' from source 'https://api.nuget.org/v3/index.json': The author primary signature validity period has expired. [/src/Anonymized.sln]
It happens for all of my NuGet packages.
If I run it outside the container, it works just fine.
I am using the image mcr.microsoft.com/dotnet/sdk:5.0. Could it be that the Docker image I am running it in has expired certificates somehow?
It worked until a couple of hours back.
Edit: Not sure if it's important information, but this is all running from GitHub Actions, in Linux.

dotnet restoreoutside docker works just fine.dotnet restoreinside docker presents me for every package with exactly the same error you described for every package.docker-compose buildit happens locally as well as build server. Downloading a mentioned package manually in docker and runningdotnet nuget verify --all some.package.nupkgalso complains about UntrustedRoot. Outside docker the command completes without error.