Tag Archives: Docker Unable to load the service index for source https://api.nuget.org/v3/index.json

Docker Unable to load the service index for source https://api.nuget.org/v3/index.json

Solve docker unable to load the service index for source https://api.nuget.org/v3/index.json Questions

When deploying the NETCORE project of Jenkins, the NETCORE project pulled from git was used, and an error was reported, as shown in the figure below

The script I wrote in Jenkins is

docker build --tag jenkinstest:${BUILD_NUMBER} . 

At first, I thought that the network Ping was not working. Later, I found that the server could connect to the JSON file WGet by itself, which ruled out this possibility

after the research, it was found that the external network could not be connected in the docker container

Change the sentence to the following

docker build --tag jenkinstest:${BUILD_NUMBER} . --network=host