0
votes

Running docker build command in PowerShell and getting:

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. I don't have any problems with visual studio 2017 on nuget restore packages.

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

c#

my NuGet.Config in (AppData):

<?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?

1

1 Answers

0
votes

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:

"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"],
}