本文介绍了无法将映像推送到配置为代理缓存的Docker注册表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了指南设置一个Docker v2注册表作为Docker Hub映像的本地代理缓存.我的Docker守护程序同时配置了指向同一注册表实例的-insecure-registry -registry-mirror 选项.

I followed this guide to setup a Docker v2 Registry acting as a local proxy cache for Docker Hub images. My Docker daemon is configured with both --insecure-registry and --registry-mirror options pointing to the same registry instance.

提取图像时,将其缓存到本地存储中即可正常工作.

When pulling images it works correctly by caching them to the local store.

问题是,当我尝试将映像推送到此类本地私有注册表时,出现奇怪的 UNSUPPORTED 错误.注册表日志中说:

The problem is that when I try to push an image to such local private registry, I get a weird UNSUPPORTED error. The registry log says:

time="2015-11-09T13:20:22Z" level=error msg="response completed with error" err.code=UNSUPPORTED err.message="The operation is unsupported." go.version=go1.4.3 http.request.host="my.registry.io:5000" http.request.id=b1faccb3-f592-4790-bbba-00ebb3a3bfc1 http.request.method=POST http.request.remoteaddr="192.168.0.4:57608" http.request.uri="/v2/mygroup/myimage/blobs/uploads/" http.request.useragent="docker/1.9.0 go/go1.4.2 git-commit/76d6bc9 kernel/3.16.0-4-amd64 os/linux arch/amd64" http.response.contenttype="application/json; charset=utf-8" http.response.duration=2.035918ms http.response.status=405 http.response.written=78 instance.id=79970ec3-c38e-4ebf-9e83-c3890668b122 vars.name="mygroup/myimage" version=v2.2.0

如果我在注册表上禁用了代理设置,则该推送可以正常工作.我是否在配置中缺少某些内容,或者仅仅是私有注册表无法同时充当代理缓存?

If I disable proxy setting on the registry then the push works correctly. Am I missing something on the configuration or it is just that a private registry cannot act as a proxy cache at the same time?

推荐答案

我自己也遇到了这个问题.事实证明,不支持推送到配置为代理的私有注册表.见

Just ran into this myself. Turns out pushing to a private registry configured as a proxy is not supported. See

https://docs.docker.com/registry/configuration/#proxy

目前不支持推送到配置为通过缓存的注册表中".

"Pushing to a registry configured as a pull through cache is currently unsupported".

那太糟了.现在,我将不得不将本地代理缓存设置为单独的注册表.

That is too bad. Now I will have to will have to setup the local proxy cache as a separate registry.

这篇关于无法将映像推送到配置为代理缓存的Docker注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 07:39