docker x509: certificate has expired or is not yet valid
系统环境:centos 6.5
内核版本:2.6.32-696.1.1.el6.x86_64
程序版本:Docker version 1.7.1, build 786b29d/1.7.1
问题:下载镜像报错:
# docker search centos
Error response from daemon: Get https://index.docker.io/v1/search?q=centos: x509: certificate has expired or is not yet valid
这种错误,一般都是本地系统时间错误导致报错证书过期,所以先查看本地系统时间
解决方式:
1. 查看时间,发现时间不对
# date
Mon Apr 3 19:36:54 CST 2017
2. 同步时间
# ntpdate cn.pool.ntp.org
17 Apr 17:40:45 ntpdate[32206]: step time server 202.112.29.82 offset 5262859.193967 sec
3. 查看时间是否正常
date # 时间同步成功
Mon Aug 7 11:28:43 CST 2017
4. 成功下载镜像(问题解决)
# docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
centos The official build of CentOS. 3551 [OK]
jdeathe/centos-ssh CentOS-6 6.9 x86_64 / CentOS-7 7.3.1611 x8... 79 [OK]
tutum/centos Simple CentOS docker image with SSH access 33
kinogmt/centos-ssh CentOS with SSH 16 [OK]
centos/postgresql-94-centos7 PostgreSQL 9.4 SQL database server