gpt4 book ai didi

ubuntu - Docker 私有(private)注册表

转载 作者:太空宇宙 更新时间:2023-11-03 16:50:58 26 4
gpt4 key购买 nike

在虚拟服务器 ubuntu 14.04 上,我安装了 docker 并尝试将图像推送到本地注册表。我关注了this guide on the Docker blog但是当我尝试推送图像时,我得到了这个输出:

Error: Invalid registry endpoint https://xx.xx.xx.xx/v1/: Get https://xx.xx.xx.xx/v1/_ping: x509: certificate has expired or is not yet valid. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add --insecure-registry xx.xx.xx.xx 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/xx.xx.xx.xx/ca.crt

我尝试在 /etc/default/docker 文件中添加 --insecure-registry xx.xx.xx.xx 并重启 docker 服务。Docker 无法以消息 /proc/self/fd/9: 17:/etc/default/docker: --insecure-registry: not found 启动。

PS:我在 docker 容器中运行我的注册表

最佳答案

我在 Ubuntu 12.04 和 Docker 1.4.1 上遇到了同样的问题。这是我的解决方案:

$ sudo docker push "[host:ip:v6:addr:ess:is:here]:5000/myImage"
FATA[0002] Error: Invalid registry endpoint https://[host:ip:v6:addr:ess:is:here]:5000/v1/: Get https://[host:ip:v6:addr:ess:is:here]:5000/v1/_ping: EOF. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry [host:ip:v6:addr:ess:is:here]: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/[host:ip:v6:addr:ess:is:here]:5000/ca.crt

所以,我有一个错误。

$ ps axwww | grep /usr/bin/docker
14655 ? Ssl 2:06 /usr/bin/docker -d
14869 pts/0 S+ 0:00 grep /usr/bin/docker

注意,/usr/bin/docker 没有额外的参数。

$ echo 'DOCKER_OPTS="--insecure-registry [host:ip:v6:addr:ess:is:here]:5000"' | sudo tee -a /etc/default/docker
DOCKER_OPTS="--insecure-registry [host:ip:v6:addr:ess:is:here]:5000"
$ sudo service docker restart
docker stop/waiting
docker start/running, process 15615

让我们检查参数是否出现:

$ ps axwww | grep /usr/bin/docker
15615 ? Ssl 0:00 /usr/bin/docker -d --insecure-registry [host:ip:v6:addr:ess:is:here]:5000
15663 pts/0 S+ 0:00 grep /usr/bin/docker

是的,他们有。再尝试一次:

$ sudo docker push "[host:ip:v6:addr:ess:is:here]:5000/myImage"
The push refers to a repository [[host:ip:v6:addr:ess:is:here]:5000/myImage] (len: 1)
Sending image list
Pushing repository [host:ip:v6:addr:ess:is:here]:5000/myImage (1 tags)
511136ea3c5a: Image successfully pushed
27d47432a69b: Pushing [================================================> ] 189.8 MB/197.2 MB 0

关于ubuntu - Docker 私有(private)注册表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27406371/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com