【发布时间】:2019-04-12 06:20:44
【问题描述】:
我在构建 docker 映像时使用 dotnet:2.1-sdk 作为包。 RUN dotnet restore 命令失败并出现以下错误:
**error : Unable to load the service index for source https://api.nuget.org/v3/index.json.**
**error : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond**
**The command 'cmd /S /C dotnet restore' returned a non-zero code: 1**
这是代理的问题,因为如果我绕过公司网络并连接到我的个人网络,它就可以工作。
我还尝试将 NuGet.Config 文件放置在源目录中,并尝试将其复制到 WORKDIR。没有任何效果。
请告诉我设置“代理”以使 dotnet restore 在 docker 环境中工作的过程。
谢谢。
【问题讨论】:
标签: c# docker .net-core nuget dockerfile