解决Error response from daemon: Get https://registry-1.docker.io/v2/: x509: certificate signed by unknown authority
阿里云服务器安装的docker一直报错,后来查阅老外的记录解决了问题。过程如下。
安装 ca-certificates
yum update ca-certificates || sudo yum -y reinstall ca-certificates
创建目录 /etc/docker/certs.d
mkdir -p /etc/docker/certs.d/registry-1.docker.io:443
复制 SSL 证书
mv www.spinach.ink.pem /etc/docker/certs.d/registry-1.docker.io:443/server.crt mv www.spinach.ink.key /etc/docker/certs.d/registry-1.docker.io:443/server.key
重启 Docker
systemctl restart docker
此时重启docker,基本上就修复了。