您的位置:首页 > 运维架构 > Docker

docker “FATA[0162] ... connection timed out" 错误改正方法

2015-06-12 09:31 736 查看
在ubuntu14.04下面安装docker后,运行sudo docker run hello-world,提示下面的错误,

Unable to find image 'hello-world:latest' locally

Pulling repository hello-world

FATA[0162] Get https://index.docker.io/v1/repositories/library/hello-world/images: dial tcp 162.242.195.84:443: connection timed out

连接远程的docker库出错,判断是在内网需要使用代理。参考stackoverflow的贴子,添加代理的方法如下:

1)修改/etc/default/docker文件,把其中“export http_proxy” 那段注释打开,然后把IP地址改成代理服务器地址,
# If you need Docker to use an HTTP proxy, it can also be specified here.

export http_proxy="http://192.168.1.1:8888/"

2)重启docker服务,

service docker restart

附注:stackoverflow原帖链接http://stackoverflow.com/questions/23111631/cannot-download-docker-images-behind-a-proxy
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: