使用docker在搜索或者拉取镜像的时候报错如下:
Error response from daemon: Get https://index.docker.io/v1/search?q=mysql&n=25: x509: certificate has expired or is not yet valid
报错信息说证书已经过期或者尚未生效,此时需要检查系统时间是否是正常的,
date
![](https://i-blog.csdnimg.cn/blog_migrate/0d0c120bc3a9a4904e4a0f35f8eb4cb0.png)
如果是时间不对,则需要进行同步
ntpdate cn.pool.ntp.org
如果提示不存在 ntpdate 命令需要先安装该命令:
yum install ntpdate
执行完成以后重新启动docker
systemctl restart docker