gpt4 book ai didi

proxy - 在代理后面拉取 docker 镜像

转载 作者:行者123 更新时间:2023-12-01 16:09:39 25 4
gpt4 key购买 nike

每当我使用校园的 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

我的研究带领我跨越了 this帖子似乎与我遇到的情况一致,但建议的修复没有奏效。我该怎么做才能避免将来出现此问题?

最佳答案

正如我在另一个上下文(Windows、公司代理)中解释的那样,您需要在 Dockerfile 中设置 HTTP_PROXY 环境变量(如果您的 Dockerfile 需要访问互联网)或在您的 session 环境变量 ( in a .profile or .bashrc ) 中:

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,您可以将那些放在外面 Dockerfile with build-timeargument passing (合并到 PR 15182 中)。

关于proxy - 在代理后面拉取 docker 镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33050008/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com