繁体   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