私有镜像仓库拉取报证书错误:x509: certificate signed by unknown authority
1. 容器运行时为Docker
cat >/etc/docker/daemon.json <<EOF
{
"graph": "/var/lib/docker",
"registry-mirrors": ["https://registry.cn-hangzhou.aliyuncs.com", "https://harbor.example.com"],
"insecure-registries": ["https://harbor.example.com"],
"live-restore": true,
"exec-opts": ["native.cgroupdriver=systemd"],
"storage-driver": "overlay2",
"log-driver": "json-file",
"log-opts": {
"max-size": "500m",
"max-file": "3"
}
}
EOF
systemctl restart docker.service
systemctl status docker.service
2. 容器运行时为Containerd
mkdir -p /etc/containerd/certs.d/harbor.example.com/
cat >/etc/containerd/certs.d/harbor.example.com/hosts.toml <<EOF
[host."https://harbor.example.com"]
capabilities = ["pull", "resolve", "push"]
skip_verify = true
EOF
cat >>/etc/containerd/config.toml <<EOF
[plugins."io.containerd.grpc.v1.cri".registry.configs."harbor.example.com".auth]
username = "admin"
password = "Harbor12345"
EOF
systemctl restart containerd.service
systemctl status containerd.service
标签:取报,certificate,x509,unknown,authority,etc
From: https://www.cnblogs.com/wang-hongwei/p/17024594.html