windows - 如何在 Docker 内运行的 Windows 上配置代理服务器?
问题描述
我在 Windows Server 2019 上运行 Docker,在 Docker 中我运行 servercore:ltsc2019。但我未能正确配置代理服务器。
主机和 docker 守护进程配置为使用代理服务器。我可以提取图像并运行它,但是,正在运行的容器似乎没有使用代理服务器。
我可以ping内部和外部主机。我也可以从内部服务器下载:(New-Object System.Net.WebClient).DownloadString('http://a.server.lokal')
. 但是如果我尝试外部地址,我会得到一个例外:
Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"
我已经尝试使用以下方法设置代理服务器:
netsh winhttp set proxy "http://<ip>:<port>"
并且:
$rkey="HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
Set-ItemProperty -path $rkey ProxyEnable -value 1
Set-ItemProperty -path $rkey ProxyServer -value "http://<ip>:<port>"
但这也无济于事。
那么如何配置代理服务器呢?
解决方案
推荐阅读
- maven - 无法从 Google Cloud Storage 获取存储库
- python - 将日期时间数据框与周期数据框进行比较
- c# - 在选择索引更改的同时显示加载屏幕
- linux - 由于对 Nuget 的 SSL 身份验证,.NET Core 构建在 docker linux 容器中失败
- python - 减去按一列分组的列的平均值
- php - SimpleXMLElement 命名空间的问题
- android - 将启动画面修复为 portlait
- java - 使用 Jersey 对查询数组参数进行排序
- python - 将 Pyspark 作业从 Windows 驱动程序提交到 Ubuntu Spark 集群时出现问题
- javascript - 外部 JS 文件在 Angular 7 中工作,但在 8 中不工作