我正在尝试使用 docker windows container构建图像。这是我的 dockerfile
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as installer
RUN Invoke-WebRequest -URI 'www.google.com'
Run Code Online (Sandbox Code Playgroud)
当我运行它时,它无法连接到 google.com
Invoke-WebRequest : The remote name could not be resolved: 'www.google.com'
At line:1 char:73
Run Code Online (Sandbox Code Playgroud)
我在公司网络上工作,我尝试使用设置代理
RUN netsh winhttp set proxy proxy-server="http://proxy.com:80" bypass-list="*.xyz.com"
并导入了注册表HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
我的容器内的 ipconfig /all 给出以下结果
Windows IP Configuration
Host Name . . . . . . . . . . . . : 0d5119fe9ce4
Primary Dns Suffix . . . . . . . :
Node Type . . . . …Run Code Online (Sandbox Code Playgroud)