在Dockerfile和外部Docker的Ubuntu 16.04服务器上,Dotnet还原失败

时间:2018-08-02 11:49:23

标签: .net docker asp.net-core proxy ubuntu-16.04

在主机上的Dockerfile或ubuntu shell中运行dotnet restore命令时,显示以下错误:

 Restoring packages for /src/Customer/Customer.API/Customer.API.csproj...
 Restoring packages for /src/Customer/Customer.DTO/Customer.DTOs.csproj...
/usr/share/dotnet/sdk/2.1.302/NuGet.targets(114,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/src/Customer/Customer.API/Customer.API.csproj]
/usr/share/dotnet/sdk/2.1.302/NuGet.targets(114,5): error :   The SSL connection could not be established, see inner exception. [/src/Customer/Customer.API/Customer.API.csproj]
/usr/share/dotnet/sdk/2.1.302/NuGet.targets(114,5): error :   Authentication failed because the remote party has closed the transport stream. [/src/Customer/Customer.API/Customer.API.csproj]

我还设置了http_proxy和https_proxy环境变量(企业代理),并且成功下载了docker映像,只有此命令失败。

编辑: 现在的错误是这样的:

/usr/share/dotnet/sdk/2.1.302/NuGet.targets(114,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/home/dev/Repos/MVPChina/Customer/Customer.API/Customer.API.csproj]
/usr/share/dotnet/sdk/2.1.302/NuGet.targets(114,5): error :   An error occurred while sending the request. [/home/dev/Repos/MVPChina/Customer/Customer.API/Customer.API.csproj]
/usr/share/dotnet/sdk/2.1.302/NuGet.targets(114,5): error :   SSL connect error [/home/dev/Repos/MVPChina/Customer/Customer.API/Customer.API.csproj]

此外,我无法从此ubuntu服务器ping 8.8.8.8或www.google.com

curl命令也会失败:

$ curl https://api.nuget.org/v3/index.json 
curl: (35) gnutls_handshake() failed: The TLS connection was non-properly terminated.

0 个答案:

没有答案