簡體   English   中英

Asp.net Core的Docker容器上的Nuget CA證書錯誤

[英]Nuget CA certificates error on a docker container of Asp.net core

我正在嘗試構建一個asp.net代碼應用程序的docker容器,嘗試檢索nuget包時出現錯誤

docker build -t my:container。

Sending build context to Docker daemon  9.58 MB
Step 1 : FROM microsoft/dotnet:latest
 ---> 3693707d4f7f
Step 2 : COPY . /app
 ---> Using cache
 ---> 22a461236738
Step 3 : WORKDIR /app
 ---> Using cache
 ---> 8bea2af489ad
Step 4 : RUN dotnet restore
 ---> Running in 5fbfe078c820
log  : Restoring packages for /app/project.json...
error: Unable to load the service index for source https://api.nuget.org/v3/index.json.
error:   An error occurred while sending the request.
error:   Peer certificate cannot be authenticated with given CA certificates
The command 'dotnet restore' returned a non-zero code: 1

我正在使用的dockerfile是一個非常標准的文件,它基於microsoft / dotnet:latest容器。

FROM microsoft/dotnet:latest
COPY . /app
WORKDIR /app

RUN ["dotnet", "restore"]
RUN ["dotnet", "build"]

EXPOSE 9881/tcp
ENV ASPNETCORE_URLS http://*:9881

ENTRYPOINT ["dotnet", "run"]

這曾經工作了一段時間,似乎已經壞了,但我不知道那會是什么。

問題是我一直在使用docker的實驗版本1.12.3。

現在,我在Windows上安裝了最新的正式版本(仍然是1.12.3,但未標記為實驗性的),因此一切正常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM