gpt4 book ai didi

Windows 镜像的 Docker 镜像

转载 作者:行者123 更新时间:2023-12-02 18:06:03 25 4
gpt4 key购买 nike

再会!
我在配置 docker 私有(private)注册表时遇到问题。我可以在 Linux RHEL 上创建一个 docker 私有(private)注册表。我将它配置为镜像,我可以从全局 DOCKER HUB 中提取图像,对于 Linux 来说没有问题。但是当我尝试将此私有(private)注册表配置为 Windows 机器的镜像时。我可以从 mcr.microsoft.com 中提取图像。有谁能够帮助我?

对 LINUX 正确:

version: 0.1
log:
fields:
service: registry
storage:
filesystem:
rootdirectory: /var/lib/registry
http:
addr: :5000
proxy:
remoteurl: https://registry-1.docker.io

如果我改变
proxy:
remoteurl: https://mcr.microsoft.com

不起作用。

最佳答案

让它像这样工作:

我的 config.yml~/.docker/docker-registry .它看起来像这样:

version: 0.1
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3
proxy:
remoteurl: https://mcr.microsoft.com

我像这样运行注册表图像:
docker run --restart=always -p 5000:5000 --name v2-mirror -v ~/.docker/docker-registry:/var/lib/registry --detach registry:2 serve /var/lib/registry/config.yml

在我的情况下,可以从 172.16.68.1:5000 的 Windows 机器访问该容器。

然后我可以做一个 docker pull 172.16.68.1:5000/windows/nanoserver:1809
请注意,“拉入式缓存”功能不适用于官方 docker hub 以外的注册表,请参阅 docker doc :

It’s currently not possible to mirror another private registry. Only the central Hub can be mirrored.

关于Windows 镜像的 Docker 镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56636907/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com