将docker图像拖放到代理之后

无论什么时候我在校园里使用无线networking,我都遇到了麻烦。 试图拉或运行需要被拉的图像给我以下错误:

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 

我的研究已经引导我通过这个post,似乎与我正在经历的一致,但build议的修复程序没有奏效。 我能做些什么来避免这个问题呢?

正如我在另一个上下文(Windows,企业代理)中所解释的,您需要在Dockerfile(如果您的Dockerfile需要访问Internet)或您的会话环境variables( 在.profile.bashrc )中设置HTTP_PROXY环境variables:

 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 

请注意,使用docker 1.9,您可以通过构build时间parameter passing ( PR 15182中的合并)将其留 Dockerfile 之外