title: Not able to access internet inside docker windows container
body: <p>I am trying to build an image using docker <strong>windows container</strong>. Here is my dockerfile</p>
  
  <pre><code>FROM mcr.microsoft.com/windows/servercore:ltsc2019 as installer
  RUN Invoke-WebRequest -URI 'www.google.com'
  </code></pre>
  
  <p>When I run this it is failing to connect to google.com</p>
  
  <pre><code>Invoke-WebRequest : The remote name could not be resolved: 'www.google.com'
  At line:1 char:73
  </code></pre>
  
  <p>I am working on a corporate network and I tried setting proxy using 
  <code>RUN netsh winhttp set proxy proxy-server="http://proxy.com:80" bypass-list="*.xyz.com"</code>
  and also imported the registry <code>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings</code></p>
  
  <p>ipconfig /all inside my container gives below result</p>
  
  <pre><code>Windows IP Configuration
  
     Host Name . . . . . . . . . . . . : 0d5119fe9ce4
     Primary Dns Suffix  . . . . . . . :
     Node Type . . . . . . . . . . . . : Hybrid
     IP Routing Enabled. . . . . . . . : No
     WINS Proxy Enabled. . . . . . . . : No
  
  Ethernet adapter Ethernet:
  
     Connection-specific DNS Suffix  . :
     Description . . . . . . . . . . . : Microsoft Hyper-V Network Adapter
     Physical Address. . . . . . . . . : 00-15-5D-B4-55-54
     DHCP Enabled. . . . . . . . . . . : Yes
     Autoconfiguration Enabled . . . . : Yes
     Link-local IPv6 Address . . . . . : fd80::a1f4:ab74:983:af83%4(Preferred)
     IPv4 Address. . . . . . . . . . . : 172.xxx.xxx.xx(Preferred)
     Subnet Mask . . . . . . . . . . . : 255.xxx.xxx.xx
     Default Gateway . . . . . . . . . : 172.xxx.xxx.xx
     DHCPv6 IAID . . . . . . . . . . . : 67114333
     DHCPv6 Client DUID. . . . . . . . : 00-01-40-01-25-D1-CB-C4-00-15-5D-D4-A5-54
     DNS Servers . . . . . . . . . . . : 172.xxx.xxx.xx
                                         10.xxx.xxx.xx
     NetBIOS over Tcpip. . . . . . . . : Disabled
  </code></pre>
  
  <p>I suspect there is some dns/firewall issue or not setting proxy in a correct way. Can someone help me in identifying the root cause and fixing this issue.</p>