I'm running Docker on Windows Server 2019 and within Docker I run servercore:ltsc2019. But I fail to configure the proxy server correctly.
The host and the docker daemon are configured to use a proxy server. I can pull the image and run it, however, the running container seems to not using the proxy server.
I can ping internal and external hosts. Also I can download from internal servers: (New-Object System.Net.WebClient).DownloadString('http://a.server.lokal'). But if I try external addresses, I get an exception:
Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"
I have already tried to set the proxy server using:
netsh winhttp set proxy "http://<ip>:<port>"
and also:
$rkey="HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
Set-ItemProperty -path $rkey ProxyEnable -value 1
Set-ItemProperty -path $rkey ProxyServer -value "http://<ip>:<port>"
But that didn't help either.
So how can I configure the proxy server?