使用 microsoft/aspnet docker 图像时出现 windows 容器错误的 Service Fabric

Service Fabric with windows container error using microsoft/aspnet docker image

我可以部署到本地 Service Fabric 集群并且运行良好。当我尝试将它部署到我的 azure service fabric 集群时,它出错并显示

Error event: SourceId='System.Hosting', Property='Download:1.0:1.0:5fb96531-7b75-42d0-8f23-6a9e42f0bda4'.
There was an error during download.System.Fabric.FabricException (-2147017731)
Container image download failed for ImageName=microsoft/aspnet with unexpected error. Exception=System.Exception: Container image history check failed after successful download. ImageName=microsoft/aspnet.
   at Hosting.ContainerActivatorService.ContainerImageDownloader.d__6.MoveNext().

当谷歌搜索这个错误时,常见的答案是虚拟机硬盘驱动器已满(检查我的一个节点,超过 100gb 可用)或者虚拟机操作系统错误(在虚拟机规模集上验证它是 运行 2016-Datacenter-with-Containers)。似乎还有一些人提到虚拟机上没有足够的资源,所以我将它们提高到 Standard_D3_v2,这应该足够了。

我确实看到有人提到增加容器下载超时。容器超过 5gb,因此这可能是一个问题,并且可以在本地工作,因为它来自 docker 缓存。不幸的是,我不确定如何轻松增加超时。

还有什么可能导致此问题?

对于这种大小的图片,很可能是下载超时。

你可以试试:

  • 使用与集群位于同一区域的私有存储库,例如 'Azure Container Registry',您可能会获得更高的下载速度
  • 如果瓶颈在您的网络上,请增加 VM 大小,更大的 VM 具有更多带宽。
  • 配置集群以等待更长的时间来下载图像。您可以尝试按照 here
  • 所述设置 ContainerImageDownloadTimeout

这是在集群配置中设置的,您的集群清单将包含如下部分:

{
        "name": "Hosting",
        "parameters": [
          {
              "name": "ContainerImageDownloadTimeout",
              "value": "1200"
          }
        ]
}

要更改现有集群的设置,您可以按照找到的说明进行操作 here and

确保您定位到(基本)图像的正确版本。 有几个要choose起。

图像的版本必须 be compatible with 您在主机上 运行 Windows 的版本。