我正在尝试使用从以下位置获取的图像设置私有 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
旗帜。