系统

[root@dev-master-105 ~]# uname -a 
Linux dev-master-105 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

错误现象

[root@dev-master-105 data]# docker pull harbor.enncloud.cn/enncloud/hyperkube-amd64:v1.11.2
Error response from daemon: Get https://harbor.enncloud.cn/v1/_ping: x509: failed to load system roots and no roots provided

#docker login failed
Login did not succeed, error: Error response from daemon: Get https://registry.jiagouyun.com/v2/: x509: certificate has expired or is not yet valid,

原因是未设置 “insecure-registries”: [“example.com”]不安全镜像仓库的域名
解决办法

{
 "insecure-registries": ["example.com"],
  "hosts": ["unix:///var/run/docker.sock"],
  "storage-driver": "devicemapper",
  "storage-opts": [
  "dm.basesize=10G",
  "dm.thinpooldev=/dev/mapper/docker-thinpool",
  "dm.use_deferred_removal=true",
  "dm.use_deferred_deletion=true"
  ],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "20m",
    "max-file": "10"
  }
}

重新登录 docker login -u user -p password
搞定

Logo

更多推荐