Unresolved domain names while docker build

Antoine - Nov 6 '20 - - Dev Community

Photo by Kyle Glenn on Unsplash

What to do when you have github.com or chocolatey.org cannot be resolved when you try to do docker build.

Multiple possible course of action:

  • use --add-host argument in the build to give resolution

  • use --network "Default Switch" argument, to specify to RUN commands which network to use

  • add in dockerfile, for example:

RUN echo 104.20.73.28 chocolatey.org >> "C:\Windows\System32\drivers\etc\hosts"
Enter fullscreen mode Exit fullscreen mode

Hope this helps !

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player