Docker Community Forums

Share and learn in the Docker community.

Docker pull works, docker run curl https://https://api.nuget.org/v3/index.json does not work

I have installed docker for desktop in my windows 10 laptop. My laptop has Symantec installed. It is as per company policy.
Docker engine version is 19.03.5
Docker desktop version is 2.10.5
I am trying to build a dotnet application, which downloads external references from nuget, It is similar to npm or mvn or bower

I am able to pull the images from internet using the pull command and succesfully create images
e.g.
docker pull pingcap/tidb

But my docker could not connect to internet using the below command in docker build file. I have intentionally put space below, actual code does not have spaces
RUN curl https: // api .nuget.org/v3/index.json -v

It is giving me the below error message
Closing connection 0
curl: (6) Could not resolve host: api. nuget. org
Could not resolve host: api. nuget. org
The command ‘cmd /S /C curl https: // api. nuget. org/v3/index.json -v’ returned a non-zero code:

I tried the below optionsafter reading through stack overflow

  1. Restarted Docker desktop
  2. Restarted docker service from services.msc
  3. Switched to linux container and then back to windows container
  4. Made wifi as the lowest network interface number
  5. Opened hyper-v manager and manually added a switch with “external”
  6. Add a firewall rule to allow all connection from program “com.docker.service”