“dotnet恢复”失败,“SSL对等证书或SSH远程密钥不正确”

我正在做一个Docker容器内的dotnet恢复下面的错误信息:

christian@debian:~/workspace$ docker build -t projectimage:v2 . Sending build context to Docker daemon 4.336 MB Step 1/9 : FROM microsoft/dotnet:1.1.1-sdk ---> 6aa7ef4f1f91 Step 2/9 : ADD https://adeartifactory/artifactory/tools/certificates/ca-bundle.crt /usr/local/share/ca-certificates/ Downloading 4.92 kB/4.92 kB ---> Using cache ---> 16d949cfeb21 Step 3/9 : RUN update-ca-certificates ---> Using cache ---> b86a8b2407e6 Step 4/9 : RUN mkdir /app ---> Using cache ---> c34785f331f0 Step 5/9 : COPY . /app ---> 93f3fd145ba2 Removing intermediate container 67f454eea5b7 Step 6/9 : WORKDIR /app ---> fe3cc459c87e Removing intermediate container d0f14b824830 Step 7/9 : RUN dotnet restore . --source https://adeartifactory/artifactory/api/nuget/nuget-all ---> Running in 111d2a75d82d Restoring packages for /app/Api.csproj... Retrying 'FindPackagesByIdAsyncCore' for source 'https://adeartifactory/artifactory/api/nuget/nuget-all/FindPackagesById()?id='Microsoft.ApplicationInsights.AspNetCore''. An error occurred while sending the request. SSL peer certificate or SSH remote key was not OK Retrying 'FindPackagesByIdAsyncCore' for source 'https://adeartifactory/artifactory/api/nuget/nuget-all/FindPackagesById()?id='Swashbuckle''. An error occurred while sending the request. SSL peer certificate or SSH remote key was not OK Retrying 'FindPackagesByIdAsyncCore' for source 'https://adeartifactory/artifactory/api/nuget/nuget-all/FindPackagesById()?id='Microsoft.ApplicationInsights.AspNetCore''. An error occurred while sending the request. SSL peer certificate or SSH remote key was not OK Retrying 'FindPackagesByIdAsyncCore' for source 'https://adeartifactory/artifactory/api/nuget/nuget-all/FindPackagesById()?id='Swashbuckle''. An error occurred while sending the request. SSL peer certificate or SSH remote key was not OK /usr/share/dotnet/sdk/1.0.1/NuGet.targets(97,5): error : Failed to retrieve information about 'Microsoft.ApplicationInsights.AspNetCore' from remote source 'https://adeartifactory/artifactory/api/nuget/nuget-all/FindPackagesById()?id='Microsoft.ApplicationInsights.AspNetCore''. [/app/Api.sln] /usr/share/dotnet/sdk/1.0.1/NuGet.targets(97,5): error : An error occurred while sending the request. [/app/Api.sln] /usr/share/dotnet/sdk/1.0.1/NuGet.targets(97,5): error : SSL peer certificate or SSH remote key was not OK [/app/Api.sln] The command '/bin/sh -c dotnet restore . --source https://adeartifactory/artifactory/api/nuget/nuget-all' returned a non-zero code: 1 

Dockerfile:

 FROM microsoft/dotnet:1.1.1-sdk ADD https://adeartifactory/artifactory/tools/certificates/ca-bundle.crt /usr/local/share/ca-certificates/ RUN update-ca-certificates RUN mkdir /app COPY . /app WORKDIR /app RUN dotnet restore . --source https://adeartifactory/artifactory/api/nuget/nuget-all RUN dotnet publish -c Release -o out ENTRYPOINT ["dotnet", "out/Api.dll"] 

这似乎是相同的,但不解决问题:

“dotnet恢复”失败,“SSL对等证书或SSH远程密钥不正确”

任何想法?

问候,基督徒

我再也不会收到错误消息,而是使用更新版本的dotnet sdk。

 FROM microsoft/dotnet:2.0.0-sdk