docker 基于 windowsservercore 的下载问题(Appveyor,Visual Studio 2017)
Problems on downloads in docker based on windowsservercore (Appveyor, Visual Studio 2017)
我有一个关于 windowsservercore
docker 图片文件下载的小问题。
我在此处列出了一张 docker 小图片:https://github.com/EndurantDevs/sonarqube-mysql-windows-docker
如您所见 - 有四个相似的 Docker 文件:SonarQube 的 2 个版本基于 Windows 容器的 2 个版本(nanoserver
和 windowsservercore
, 通过 openjdk
图片 )
在构建过程中,nanoserver
上所需文件的下载进展顺利。
但是,在 windowsservercore
图像上我遇到了这个问题:
Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send. At line:1 char:1
+ Invoke-WebRequest https://sonarsource.bintray.com/Distribution/sonarq ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:Htt pWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe ll.Commands.InvokeWebRequestCommand
因此,从 nanoserver
.
运行良好的相同服务器下载相同文件时会出现问题
应用包括 Tls12 在内的所有已知修复程序都没有帮助。
我认为这是 Appveyor 端主机上的问题。但是,即使是我尝试过的注册表修复也无济于事。
这里是要比较的构建信息:https://ci.appveyor.com/project/dnikolayev/sonarqube-mysql-windows-docker/build/1.0.53
尝试在 Invoke-WebRequest
之前添加 [Net.ServicePointManager]::SecurityProtocol
命令以显示在 docker 实例上启用的协议并比较 "good" 和 "bad" 一个。比较后,您可以决定如何更新 SSL 设置。
通过设置 [Net.ServicePointManager]::SecurityProtocol = 'Ssl3', 'Tls', 'Tls11', 'Tls12'
将允许所有的最宽容。这不会危及您的安全,因为这将允许 client 与服务器协商任何安全协议,但无论如何它都会尝试使用最高可能。但是请确保您可以更加严格,使用 [Net.ServicePointManager]::SecurityProtocol
命令比较 "good" 和 "bad" 构建会给您一个想法。
我有一个关于 windowsservercore
docker 图片文件下载的小问题。
我在此处列出了一张 docker 小图片:https://github.com/EndurantDevs/sonarqube-mysql-windows-docker
如您所见 - 有四个相似的 Docker 文件:SonarQube 的 2 个版本基于 Windows 容器的 2 个版本(nanoserver
和 windowsservercore
, 通过 openjdk
图片 )
在构建过程中,nanoserver
上所需文件的下载进展顺利。
但是,在 windowsservercore
图像上我遇到了这个问题:
Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send. At line:1 char:1
+ Invoke-WebRequest https://sonarsource.bintray.com/Distribution/sonarq ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:Htt pWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe ll.Commands.InvokeWebRequestCommand
因此,从 nanoserver
.
应用包括 Tls12 在内的所有已知修复程序都没有帮助。 我认为这是 Appveyor 端主机上的问题。但是,即使是我尝试过的注册表修复也无济于事。
这里是要比较的构建信息:https://ci.appveyor.com/project/dnikolayev/sonarqube-mysql-windows-docker/build/1.0.53
尝试在 Invoke-WebRequest
之前添加 [Net.ServicePointManager]::SecurityProtocol
命令以显示在 docker 实例上启用的协议并比较 "good" 和 "bad" 一个。比较后,您可以决定如何更新 SSL 设置。
通过设置 [Net.ServicePointManager]::SecurityProtocol = 'Ssl3', 'Tls', 'Tls11', 'Tls12'
将允许所有的最宽容。这不会危及您的安全,因为这将允许 client 与服务器协商任何安全协议,但无论如何它都会尝试使用最高可能。但是请确保您可以更加严格,使用 [Net.ServicePointManager]::SecurityProtocol
命令比较 "good" 和 "bad" 构建会给您一个想法。