docker .net5 Determining projects to restore... 失败

报错如下

/usr/share/dotnet/sdk/5.0.302/NuGet.targets(131,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/src/ApiServer/ApiServer.csproj]
/usr/share/dotnet/sdk/5.0.302/NuGet.targets(131,5): error :   The HTTP request to 'GET https://api.nuget.org/v3/index.json' has timed out after 100000ms. [/src/ApiServer/ApiServer.csproj]
The command '/bin/sh -c dotnet restore "ApiServer/ApiServer.csproj"' returned a non-zero code: 1

//添加--network=host
docker build -t net5test -f Dockerfile . --network=host

posted @ 2021-08-10 20:20  Hey,Coder!  阅读(750)  评论(0编辑  收藏  举报