这是情况。 我使用连续/ anaconda3图像的Docker 。 我有服务器(Ubuntu 16.04 LTS)configuration为使用公司代理与CNTLM包。 互联网在主机上通过本地代理工作得很好。
我还修改了cntlm.conf来监听172.17.0.1上的Docker的虚拟networking接口(docker0)。
泊坞窗也正确configuration,我可以拉图像没有问题。 一旦我部署了一个带有Anaconda镜像的容器,并且通过导出envvariableshttp_proxy="http://172.17.0.1:3128"等configuration容器来使用主机代理,我可以使用wget和curl来下载。
问题来自conda 。 我已经按照文档,我也已经导出HTTP_PROXY和HTTPS_PROXYvariables。 这不起作用。 然后我在/root目录下创build了一个.condarc文件:
proxy_servers: https: localhost:3128 http: localhost:3128
还试过ssl_verify: False 。
似乎没有任何工作 。 我总是得到以下错误:
CondaHTTPError: HTTP None None for url <https://repo.continuum.io/pkgs/free/linux-64/repodata.json.bz2> Elapsed: None An HTTP error occurred when trying to retrieve this URL. HTTP errors are often intermittent, and a simple retry will get you on your way. ProxyError(MaxRetryError("HTTPSConnectionPool(host='repo.continuum.io', port=443): Max retries exceeded with url: /pkgs/free/linux-64/repodata.json.bz2 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fd88e1d1240>: Failed to establish a new connection: [Errno 111] Connection refused',)))",),)
尝试在Dockerfile上创build这些variables:
ENV http_proxy="xxxx:xxxx" ENV https_proxy="xxxx:xxxx"
xxxx不是127.0.0.1。 该ip应该是cntlm代理的标准LAN IP。