Skip to content

Instantly share code, notes, and snippets.

@mwaaas
Created July 20, 2020 06:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwaaas/ff596c6450b6fe9d48e0bfb235ea57e8 to your computer and use it in GitHub Desktop.
Save mwaaas/ff596c6450b6fe9d48e0bfb235ea57e8 to your computer and use it in GitHub Desktop.
Windows container not accessing internet
Getting this error while building dot net application.
Unable to load the service index for source https://api.nuget.org/v3/index.json
It fails when it trys to restore packages and it can't access nutget repository
To confirm this run the following command to access PowerShell inside a container
docker run -it --rm microsoft/nanoserver:sac2016 powershell
Then while inside the container run this command to try and reach nutget repository
Invoke-WebRequest -UseBasicParsing -OutFile index.json https://api.nuget.org/v3/index.json
If it fails that's the error am talking about, not able to access internet inside the container network. Hence causing the build to fail at the restoring package step.
solution can be found here
https://github.com/docker/for-win/issues/2760#issuecomment-430889666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment