StefanScherer / dockerfiles-windows

Various Dockerfiles for Windows Containers
MIT License
1.1k stars 396 forks source link

Cannot connect to chocolatey.org or any other internet site from within container #430

Open ShamanTcler opened 4 years ago

ShamanTcler commented 4 years ago

I am having a similar issue to: https://devops.stackexchange.com/questions/2155/cannot-connect-to-chocolatey-org-or-any-other-internet-site-from-within-containe/2173#2173

This is the error message:

Step 4/4 : RUN powershell -Command     iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'));     choco feature disable --name showDownloadProgress
 ---> Running in ba5fb7c767e0
Exception calling "DownloadString" with "1" argument(s): "The remote name
could not be resolved: 'chocolatey.org'"
At line:1 char:1
+ iex ((new-object net.webclient).DownloadString('https://chocolatey.or ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

choco : The term 'choco' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:88

Yes I am corporate environment.

The answer seems to suggest a "--dns 8.8.8.8" solution.... but where and how do you make this change?

I have tried a number of proxy settings of the form: ENV ftp_proxy="http://xxx:80" ENV https_proxy="http://xxx:80" ENV http_proxy="http://xxx:80" ENV no_proxy=".xxx.com"

ENV chocolateyProxyLocation="http://xxx:80"

But these don't seem to change anything.

Advice?

Thanks Carl

farmovit commented 4 years ago

Hi @ShamanTcler,

Have you solved this problem? I have the same issue and have no idea how to fix it

StefanScherer commented 3 years ago

This kind of networking problem is often solved by using the latest Windows updates on the host and maybe current Windows base images.