[root@LIN-2F8AC9DC590 macro1.3]# docker pull XXXcode-analysis:centos7.3-1.0
Error response from daemon: Get "XXXX": x509: certificate has expired or is not yet valid: current time 2023-07-11T14:27:37+08:00 is after 2018-08-22T11:54:50Z
x509: certificate has expired or is not yet valid:
参考公司内论坛
先备份这个
/etc/docker/daemon.json
末尾增加一个配置项:
"insecure-registries":["0.0.0.0/0"]
[root@vmax26 ~]# cat /etc/docker/daemon.json
{
"storage-driver":"overlay2",
"storage-opts":["overlay2.override_kernel_check=true"],
"insecure-registries":["0.0.0.0/0"]
}
这样做的目的是:
在安装好Docker以后,想从公司搭建的私服Harbor上docker pull的时候碰上了x509问题,这个问题的原因是docker会验证网站的证书,私服没有相应的证书所以docker拒绝访问,但是我们也可以自己允许docker连接“不安全”的网站,在此记录一下解决方案:
--insecure-registry 127.0.0.1" (把127.0.0.1换成你需要允许的网址,如果有端口号需要加上端口号如127.0.0.1:8080