问题描述

通过docker pull命令来pull私有仓库image出现报错:

FATA[0010] Error: v1 ping attempt failed with error: Get https://111.xx.xx.xx/v1/_ping: dial tcp 111.xx.xx.xx:443: i/o timeout. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add --insecure-registry 111.xx.xx.xx to the daemon’s arguments. In the case of HTTPS, if you have access to the registry’s CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/111.xx.xx.xx/ca.crt

根据错误提示,是CA的问题,我们需要在docker的启动参数加上-insecure-registry 111.xx.xx.xx,所以我们需要在vi /etc/default/docker,加上

DOCKER_OPTS="$DOCKER_OPTS --insecure-registry=111.xx.xx.xx"

然后重启Docker

sudo service docker restart

但是,如果你是在OS X系统下使用boot2docker的,那么通过boot2docker ssh 进入到虚拟机,操作上述方法是不行的,当然有其他办法,那就是ssh到boot2docker虚拟机,然后修改vi /var/lib/boot2docker/profile 加入

EXTRA_ARGS="--insecure-registry=111.xx.xx.xx"

然后退出虚拟机,执行重启:

  • boot2docker down
  • boot2docker up

然后就可以从111.xx.xx.xx的私有仓库pull images了。

##文档信息