Docker had its own network layer with its own DNS service layer so additional detail from you may help CircleCI staff track down the issue as they are the only people who know how the underlying systems have been configured.
I Also have the same issue when I run dotnet restore but weird is that for one service image is build without issue but for second I have this problem with resolving api.nuget.org docker file looks similar in both cases. On the local machine, docker is built properly.
We are sorry to hear the api.nuget.org resolution is not working as expected.
It looks like there is an issue with alpine image and AWS us-east-1. CircleCI machine are running on us-east-1I believe this is causing issue. More details can be found on the GitHub issue linked below. It seems like it is happening to us and other services as well (whoever user AWS us-east-1).
If you are using alpine image change to non-alpine image. For example if you are using mcr.microsoft.com/dotnet/sdk:7.0-alpine please change it to mcr.microsoft.com/dotnet/sdk:7.0.
We will update if there is new workaround available.