【发布时间】:2014-12-29 20:49:48
【问题描述】:
我正在尝试使用从以下位置获取的图像设置一个私有 docker 注册表: https://github.com/docker/docker-registry
只需运行:docker run -p 5000:5000 registry
我只能从本地主机拉取/推送到这个存储库,但是如果我尝试从另一台机器(使用同一 LAN 上的私有地址)访问它,它会失败并显示错误消息:
*2014/11/03 09:49:04 Error: Invalid registry endpoint https ://10.0.0.26:5000/v1/':
Get https:// 10.0.0.26:5000/v1/_ping: Forbidden. If this private
registry supports only HTTP or HTTPS with an unknown CA certificate,
please add `--insecure-registry 10.0.0.26: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/10.0.0.26:5000/ca.crt*
让我抓狂的是,我可以通过以下方式成功访问它:
curl 10.0.0.26:5000
和/或curl 10.0.0.26:5000/v1/search
我也不明白应该在哪里以及如何传递--insecure-registry 标志。
【问题讨论】:
-
对于 docker 1.12,许多答案似乎已经过时,但请参阅 vikas027 答案,这对 docker 1.12(最新 ATOW)非常有用
-
在 Ubuntu 上,Docker documentation 和 this answer 对我来说效果很好。
标签: docker remote-access docker-registry