Docker Community Forums

Share and learn in the Docker community.

Network connection in docker windows container

How do I have to set up a windows container to have network connection inside? I am able to pull from

mcr.microsoft.com/windows/servercore:ltsc2019

but if I run (to install chocolatey)

RUN powershell Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1’))

I get an exception:

“The remote name could not be resolved: ‘chocolatey.org’”

I guess the RUN command is executed inside the container and I am not able to ping 8.8.8.8 e.g. from inside. I am behind a corporate proxy and I am using cisco anyconnect VPN.