Proxy 将docker图像拖到代理后面

Proxy 将docker图像拖到代理后面,proxy,dns,docker,http-proxy,dockerhub,Proxy,Dns,Docker,Http Proxy,Dockerhub,每当我在校园的wifi上使用docker时,我都会遇到麻烦。尝试拉取或运行需要拉取的映像时会出现以下错误: Error while pulling image: Get https://index.docker.io/v1/repositories/library/redis/images: dial tcp: lookup index.docker.io on 66.170.14.12:53: server misbehaving 我的研究让我看到了一篇文章,这篇文章似乎与我的经历一致,但提

每当我在校园的wifi上使用docker时,我都会遇到麻烦。尝试拉取或运行需要拉取的映像时会出现以下错误:

Error while pulling image: Get https://index.docker.io/v1/repositories/library/redis/images: dial tcp: lookup index.docker.io on 66.170.14.12:53: server misbehaving

我的研究让我看到了一篇文章,这篇文章似乎与我的经历一致,但提议的修复方案并没有奏效。将来如何避免此问题?

正如我在另一个上下文(Windows、公司代理)中所解释的,您需要在Dockerfile(如果Dockerfile需要访问internet)或会话环境变量()中设置HTTP_代理环境变量:

导出HTTP_PROXY=HTTP://:@PROXY.company:80 导出HTTPS_PROXY=http://:@PROXY.company:80 export NO_PROXY=.company、.sock、localhost、127.0.0.1、::1192.168.59.103 请注意,使用docker 1.9,您可以将这些内容保留在外部(合并到)

export HTTP_PROXY=http://<user>:<pwd>@proxy.company:80
export HTTPS_PROXY=http://<user>:<pwd>@proxy.company:80
export NO_PROXY=.company,.sock,localhost,127.0.0.1,::1,192.168.59.103