由于必须通过proxy代理上网。

使用docker pull时一直出现如下错误:

[root@centoo65 ~]# sudo HTTP_PROXY=http://186.100.4.107:808/ docker pull busybox
Pulling repository busybox
2014/09/21 23:54:08 Get https://index.docker.io/v1/repositories/busybox/images: dial tcp: lookup index.docker.io: no such host

解决办法(以centos为例,其他系统类似):

修改/etc/sysconfig/docker

HTTP_PROXY=代理主机/域名:端口
http_proxy=$HTTP_PROXY
HTTPS_PROXY=$HTTP_PROXY
https_proxy=$HTTP_PROXY
export HTTP_PROXY HTTPS_PROXY http_proxy https_proxy