简体   繁体   English

访问Docker私有注册表

[英]accessing docker private registry

I have my private docker registry running on a remote machine, which is secured by TLS and uses HTTPS. 我有一个在远程计算机上运行的私有docker注册表,该注册表由TLS保护并使用HTTPS。 Now I want to access it from my local docker-machine installed on Windows 7. I have copied the certificates to "/etc/docker/certs.d/" in the docker-machine VM and restarted docker. 现在,我想从Windows 7上安装的本地docker-machine中访问它。我已将证书复制到docker-machine VM中的“ /etc/docker/certs.d/”,然后重新启动了docker。

After this I can successfully login to my private registry using credentials, but when I try to push an image to it, it gives me a certificate signed by unknown authority error. 之后,我可以使用凭据成功登录到我的私有注册表,但是当我尝试向其推送映像时,它会给我一个certificate signed by unknown authority错误certificate signed by unknown authoritycertificate signed by unknown authority After researching a little I restarted the docker daemon with docker -d --insecure-registry https://<registry-host> , and it worked. 经过研究后,我使用docker -d --insecure-registry https://<registry-host>重新启动了docker -d --insecure-registry https://<registry-host>守护进程,并且该命令起作用了。

My question is: if I have copied my certificates to the host machine, why do I need to start the registry with the --insecure-registry option? 我的问题是:如果我已将证书复制到主机,为什么需要使用--insecure-registry选项启动--insecure-registry

I can only access the registry from another host with certificates as well as restarting docker with --insecure-registry , which looks a little wrong to me. 我只能从带有证书的另一台主机访问注册表,也只能使用--insecure-registry重新启动--insecure-registry ,这对我来说有点不对劲。

Docker version: 1.8.3 Docker版本:1.8.3

Any pointers on this would be really helpful. 任何有关此的指示将非常有帮助。

certificate signed by unknown authority 由未知权限签署的证书

The error message gives it away - your certificates are self-signed (as in not trusted by a known CA). 错误消息将其释放-您的证书是自签名的(如不受已知CA信任)。

See here . 这里

If you would like to access your registry with HTTP, follow the instructions here 如果您想使用HTTP访问注册表,请按照此处的说明进行操作

Basically (do this on the machine from which you try to access the registry): 基本上,(这样做在机器上from您尝试访问注册表):

  1. edit the file /etc/default/docker so that there is a line that reads: DOCKER_OPTS="--insecure-registry myregistrydomain.com:5000" (or add that to existing DOCKER_OPTS) 编辑文件/ etc / default / DOCKER_OPTS="--insecure-registry myregistrydomain.com:5000" ,以使一行显示为: DOCKER_OPTS="--insecure-registry myregistrydomain.com:5000" (或将其添加到现有的DOCKER_OPTS中)
  2. restart your Docker daemon: on ubuntu, this is usually service docker stop && service docker start 重新启动Docker守护进程:在ubuntu上,通常是service docker stop && service docker start

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM