繁体   English   中英

Docker Private Registry:ping尝试失败

[英]Docker Private Registry: ping attempt failed

我正在尝试建立我的私有Docker Registry,我正在遵循官方文档 我已经安装了Docker,我可以在我的服务器上运行我的注册表。 但我希望我的注册表可以更广泛地使用。 我的具有私有注册表的docker-server安装在AWS实例上。 我使用keytool创建了自己的证书和密钥:

docker run -d -p 5000:5000 --restart=always --name registry \
  -v `pwd`/certs:/certs \
  -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \
  -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \
  registry:2

我可以通过以下方式ping此实例:

ping ec2-xx-xx-xx-xx.xx-west/east-1.compute.amazonaws.com

但推动是不可能的:

The push refers to a repository [ec2-xx-xx-xx-xx.compute.amazonaws.com:5000/ubuntu] (len: 1)
unable to ping registry endpoint https://ec2-xx-xx-xx-xx.compute.amazonaws.com:5000/v0/
v2 ping attempt failed with error: Get https://ec2-xx-xx-xx-xx.compute.amazonaws.com:5000/v2/: dial tcp 10.x.x.x:5000: i/o timeout
 v1 ping attempt failed with error: Get https://ec2-xx-xx-xx-xx.amazonaws.com:5000/v1/_ping: dial tcp 10.0.x.x:5000: i/o timeout

编辑1:更改我的aws-security组后。 将端口5000设置为TCP ,错误已更改:

unable to ping registry endpoint https://ec2-xx-xx-xx-xx.compute.amazonaws.com:5000/v0/
v2 ping attempt failed with error: Get https://ec2-xx-xx-xx-xx.compute.amazonaws.com:5000/v2/: dial tcp 10.0.x.x:5000: connection refused
 v1 ping attempt failed with error: Get https://ec2-xx-xx-xx-xx.compute.amazonaws.com:5000/v1/_ping: dial tcp 10.0.x.x:5000: connection refused

如何让我的注册表可以访问其他aws实例? 我的docker日志显示以下内容。 他们找不到我的证书。

level=fatal msg="open /certs/domain.crt: no such file or directory" 

我必须将此证书放入我的容器中吗? (并由我自己或使用现有的keytool生成它)

EDIT2:我使用此文档生成了自己的证书。 生成证书后,我确实重新启动了我的docker守护程序。 我没有将domain.crt的副本执行到ca.crt,因为路径不存在。 也许我必须自己创造它?

新错误:

unable to ping registry endpoint https://ec2-xx-xx-xx-xx.compute.amazonaws.com:5000/v0/
v2 ping attempt failed with error: Get https://ec2-xx-xx-xx-xx.compute.amazonaws.com:5000/v2/: dial tcp 10.0.x.x:5000: no route to host
 v1 ping attempt failed with error: Get https://ec2-xx-xx-xx-xx.compute.amazonaws.com:5000/v1/_ping: dial tcp 10.0.x.x:5000: no route to host

但我仍然在我的docker日志中得到以下信息:

level=fatal msg="open /certs/domain.crt: no such file or directory" 

尝试执行推送后,在我现有的certs文件夹中创建了一个新的/ certs文件夹

编辑3:找到我的证书的正确目录(/ home / centos / certs / certs / *。)。 我收到以下错误:

level=fatal msg="open /certs/domain.crt: permission denied

即使我执行chmod -R 777chown -R root:root

您需要将证书放在此目录中。

    /etc/docker/certs.d/<your-domain-name>:5000/ca.crt

暂无
暂无

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

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