docker使用v1registryAPI时,它应该使用v2

我正在尝试使用自托pipe的dockerregistryv2。 我应该能够推送一个docker映像,它在运行registryv2容器的主机服务器(coreos)本地工作。 但是,当我试图推送到registry,在一个单独的机器(也coreos,相同的版本),它试图推到v1,给出这个错误:

Error response from daemon: v1 ping attempt failed with error: Get https://172.22.22.11:5000/v1/_ping: dial tcp 172.22.22.11:5000: i/o timeout. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 172.22.22.11:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/172.22.22.11:5000/ca.crt 

这两台机器的docker可执行文件是v1.6.2。 为什么它是一个工作,并推动到V2,而另一个是V1?

这里是registry的回购: https : //github.com/docker/distribution

您需要先保护registry,然后才能远程访问它,或者明确允许所有Docker守护程序访问不安全的registry。

要保护registry,最简单的select是为您的服务器购买SSL证书,但您也可以自行签署证书并分发给客户端。

要允许不安全访问,请将参数--insecure-registry myregistrydomain.com:5000添加到需要访问registry的所有守护进程。 (显然用你的域名和端口replace)。

完整的说明(包括错误消息的示例)可在以下url获得: https : //github.com/docker/distribution/blob/master/docs/deploying.md

关于错误消息,我 Docker会先尝试使用v2,由于安全问题而失败,然后尝试v1并再次失败。