Docker - 无法将图像推送到私人注册表 [英] Docker - Unable to push image to private registry

查看:140
本文介绍了Docker - 无法将图像推送到私人注册表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过拉和运行注册表图像在我的服务器上创建了我自己的私人注册表。

  sudo docker run -d -p 5000:5000注册表

之后,我尝试标记一个简单的图像并将其推送到服务器。

 code> sudo docker标签ubuntu:最新的localhost:5000 / myprivateubuntu 

我收到这个错误:

 错误:无效的注册表端点...获取...如果此私有注册表仅支持具有未知CA的HTTP或HTTPS证书,请在守护进程的参数中添加--insecure-registry localhost:5000。在HTTPS的情况下,如果您有权访问注册表的CA证书,则不需要该标志;只需将CA证书放在/etc/docker/certs.d/localhost:5000/ca.crt 

无论如何知道问题是什么?

解决方案

停止服务。

  sudo服务码头停止

重新启动服务与 - insecure-registry 参数:

  / usr / bin / docker -d  - insecure-registry localhost:5000 

或编辑 / etc / default / docker 文件并添加以下行:

  DOCKER_OPTS = -  insecure-registry localhost:5000


I have created my own private registry on my server by pulling and running the registry image.

sudo docker run -d -p 5000:5000 registry

After which, I tried to tag a simple image and push it to the server.

sudo docker tag ubuntu:latest localhost:5000/myprivateubuntu

And I received this error:

Error: Invalid registry endpoint ... Get ... If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add '--insecure-registry localhost: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/localhost:5000/ca.crt

Anyhow know what's the problem?

解决方案

stop the service.

sudo service docker stop

restart service with --insecure-registry arguments:

/usr/bin/docker -d --insecure-registry localhost:5000

or edit /etc/default/docker file and add the following line:

DOCKER_OPTS="--insecure-registry localhost:5000"

这篇关于Docker - 无法将图像推送到私人注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆