[英]NuGet with Docket Unable to load the service index for source
Running docker build command in PowerShell and getting: 在PowerShell中运行docker build命令并获取:
Unable to load the service index for source
无法加载源的服务索引
I've litterly tried all the solutions provided here: Nuget connection attempt failed "Unable to load the service index for source" and here: https://github.com/NuGet/Home/issues/5358 . 我乱丢杂乱地尝试了这里提供的所有解决方案: Nuget连接尝试失败“无法加载源的服务索引”,并且这里: https : //github.com/NuGet/Home/issues/5358 。 I don't have any problems with visual studio 2017 on nuget restore packages.
我在nuget恢复包上使用Visual Studio 2017没有任何问题。
I'm not behind a proxy or anything. 我没有代理人或任何东西。 I'm able to see json output if I browse to: https://api.nuget.org/v3/index.json
如果浏览到以下网址,则可以看到json输出: https : //api.nuget.org/v3/index.json
my NuGet.Config in (AppData): 我在(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>
Why does docker fail? 为什么Docker会失败?
After counless hours trying to figure this out this fix worked for me: 经过无数小时的尝试来找出答案,此修复程序对我有用:
Open: c:\\ProgramData\\Docker\\config\\daemon.json and add the following line: 打开:c:\\ ProgramData \\ Docker \\ config \\ daemon.json并添加以下行:
"dns": ["8.8.8.8"]
My daemon file now looks like this: 我的守护程序文件现在看起来像这样:
{
"registry-mirrors": [],
"insecure-registries": [],
"debug": true,
"experimental": true,
"dns": ["8.8.8.8"],
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.