当我做docker pull
从使用/var/run/docker.sock
运行泊坞窗(内码头工人码头工人)的容器里面,我得到这个错误:docker.sock用于docker pull的哪个ca.crt?
FATA[0000] Error response from daemon: v1 ping attempt failed with error: Get https://registry.com:5000/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 registry.com: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/registry.com:5000/ca.crt
所以我也跟着指示,并补充说目录内ca.crt
,也将不安全选项添加到/etc/default/docker
,但错误没有消失。
我想知道当我从容器内拉出时,/var/run/docker.sock
命令在哪里查找证书。特别是当使用相同的配置(ca.crt在正确的文件夹中,并且不安全的选项也被添加)从外部(主机)拉出工作时。
关闭我的头顶,拉应该从主机上运行的dockerd守护进程运行,而不是从容器内的客户端运行。 – BMitch
@BMitch这样它会从主机上查找cert文件夹(/etc/docker/certs.d/registry.com:5000/ca.crt)吗? – Casper
你使用旧的v1注册表吗? ca.crt必须包含整个链,从subCA到CA(如果是自签名或未知的)。如果它是一个已知的CA(安装了ca-certificates,对于基于Debian的发行版),您可以省略它,但它不会影响到那里。 –