2017-05-03 96 views
1

我收到以下錯誤消息話題做一個DOTNET泊塢窗容器內恢復:「DOTNET恢復」失敗「SSL等證書或SSH遠程關鍵是不OK」

[email protected]:~/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 restore" fails with "SSL peer certificate or SSH remote key was not OK"

有什麼想法?

問候, 基督教

+0

爲什麼你想在Docker鏡像中恢復?您應該發佈您的應用程序,然後從中直接構建Docker鏡像。 –

+0

我正在使用Docker容器以具有獨立的構建環境。因此,使用microsoft/dotnet:1.1.1-sdk而不是運行時映像。 –

回答

1

我不要用較新版本的SDK DOTNET的收到錯誤消息了。

FROM microsoft/dotnet:2.0.0-sdk