在Asp.net核心的docker容器上Nuget CA证书错误

时间:2016-11-29 10:06:54

标签: ssl docker nuget .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"]

这曾经工作过一段时间,似乎有些东西已经破裂,但我不知道会是什么。

1 个答案:

答案 0 :(得分:0)

问题是我一直在使用docker的实验版1.12.3。

现在我在Windows上安装了最新的官方版本(仍为1.12.3但未标记为实验版),一切正常。