Docker 注册表可以存储基本映像吗?
Can the Docker registry store base images?
我们正在设置一个服务器来托管 Windows 个容器。
该服务器从我们设置的内部 Docker 注册表获取图像。
问题是服务器无法下载图像,因为它正在尝试从 Internet 获取基本图像,而服务器没有 Internet 连接。
我找到了 troubleshooting script from Microsoft 并注意到一段话:
At least one of 'microsoft/windowsservercore' or
'microsoft/nanoserver' should be installed
- Try docker pull microsoft/nanoserver or docker pull
microsoft/windowsservercore to pull a Windows container image
由于我的电脑有互联网连接,我下载了这些镜像,将它们推送到注册表,但是在新服务器上拉取镜像失败:
The description for Event ID '1' in Source 'docker' cannot be found. The local computer may not have the necessary registry information or message DLL files to display the message, or you may not have permission to access them. The following information is part of the event:'Error initiating layer download: Get https://go.microsoft.com/fwlink/?linkid=860052: dial tcp 23.207.173.222:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.'
它试图获取的 link 是 Internet 上的基础映像,但我认为注册表存储的是完整映像,那有什么用呢?真的不能将基础镜像存储在注册表中吗?
阅读后发现:https://docs.docker.com/registry/deploying/#considerations-for-air-gapped-registries
Certain images, such as the official Microsoft Windows base images,
are not distributable. This means that when you push an image based on
one of these images to your private registry, the non-distributable
layers are not pushed, but are always fetched from their authorized
location. This is fine for internet-connected hosts, but will not work
in an air-gapped set-up.
文档然后详细说明了如何设置注册表以存储不可分发的层,但他们还说要注意不可分发层的使用条款。
所以两种可能的解决方案是:
- 确保您可以存储不可分发的层,然后重新配置注册表以存储不可分发的层
- 将服务器连接到互联网,下载基础镜像,然后使用这些镜像
我们正在设置一个服务器来托管 Windows 个容器。 该服务器从我们设置的内部 Docker 注册表获取图像。 问题是服务器无法下载图像,因为它正在尝试从 Internet 获取基本图像,而服务器没有 Internet 连接。
我找到了 troubleshooting script from Microsoft 并注意到一段话:
At least one of 'microsoft/windowsservercore' or 'microsoft/nanoserver' should be installed
- Try docker pull microsoft/nanoserver or docker pull microsoft/windowsservercore to pull a Windows container image
由于我的电脑有互联网连接,我下载了这些镜像,将它们推送到注册表,但是在新服务器上拉取镜像失败:
The description for Event ID '1' in Source 'docker' cannot be found. The local computer may not have the necessary registry information or message DLL files to display the message, or you may not have permission to access them. The following information is part of the event:'Error initiating layer download: Get https://go.microsoft.com/fwlink/?linkid=860052: dial tcp 23.207.173.222:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.'
它试图获取的 link 是 Internet 上的基础映像,但我认为注册表存储的是完整映像,那有什么用呢?真的不能将基础镜像存储在注册表中吗?
阅读后发现:https://docs.docker.com/registry/deploying/#considerations-for-air-gapped-registries
Certain images, such as the official Microsoft Windows base images, are not distributable. This means that when you push an image based on one of these images to your private registry, the non-distributable layers are not pushed, but are always fetched from their authorized location. This is fine for internet-connected hosts, but will not work in an air-gapped set-up.
文档然后详细说明了如何设置注册表以存储不可分发的层,但他们还说要注意不可分发层的使用条款。
所以两种可能的解决方案是:
- 确保您可以存储不可分发的层,然后重新配置注册表以存储不可分发的层
- 将服务器连接到互联网,下载基础镜像,然后使用这些镜像