[英]NuGet with Docket Unable to load the service index for source
在PowerShell中运行docker build命令并获取:
无法加载源的服务索引
我乱丢杂乱地尝试了这里提供的所有解决方案: Nuget连接尝试失败“无法加载源的服务索引”,并且这里: https : //github.com/NuGet/Home/issues/5358 。 我在nuget恢复包上使用Visual Studio 2017没有任何问题。
我没有代理人或任何东西。 如果浏览到以下网址,则可以看到json输出: https : //api.nuget.org/v3/index.json
我在(AppData)中的NuGet.Config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<packageManagement>
<add key="format" value="0" />
<add key="disabled" value="False" />
</packageManagement>
</configuration>
为什么Docker会失败?
经过无数小时的尝试来找出答案,此修复程序对我有用:
打开:c:\\ ProgramData \\ Docker \\ config \\ daemon.json并添加以下行:
"dns": ["8.8.8.8"]
我的守护程序文件现在看起来像这样:
{
"registry-mirrors": [],
"insecure-registries": [],
"debug": true,
"experimental": true,
"dns": ["8.8.8.8"],
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.