Windows镜像的Docker镜像 [英] Docker mirror for windows images
问题描述
美好的一天!
我在配置docker private注册表时遇到问题。我可以在Linux RHEL上创建一个docker私有注册表。我将其配置为镜像,并且可以从Linux的全局DOCKER HUB中提取图像,而不会出现问题。但是,当我尝试配置此私有注册表时,它会作为Windows计算机的镜像。我可以从mcr.microsoft.com中提取图像。有人可以帮我吗?
Good day! I have problems with configuring docker private registry. I can create a docker private registry on Linux RHEL. I configured it work as a mirror, and I can pull images from global DOCKER HUB, for Linux without a problem. But when I try to configuration this private registry work as a mirror for Windows machine. I can pull images from mcr.microsoft.com. Can anybody help me?
对于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
中。看起来像这样:
My config.yml
is in ~/.docker/docker-registry
. It looks like this:
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
我像这样运行注册表映像:
I run the registry image like this:
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
对于我来说,可以从Windows机器以172.16.68.1:5000到达容器。
In my case, the container is reachable from a windows machine at 172.16.68.1:5000.
然后我可以执行 docker pull 172.16.68.1:5000/windows/nanoserver:1809
注意那拉通gh缓存功能不适用于除官方Docker Hub以外的其他注册表,请参阅 docker文档:
Note that the "pull-through cache" feature is not available for registries other than the official docker hub, see docker doc:
当前无法镜像另一个私有注册表。只能镜像中央集线器的
。
It’s currently not possible to mirror another private registry. Only the central Hub can be mirrored.
这篇关于Windows镜像的Docker镜像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!