Docker Ubuntu Behind Proxy

2020-05-10 23:51发布

Looking at docs there is no instruction on how to run it behind a proxy. https://docs.docker.com/installation/ubuntulinux/

Reading on forums, the instruction is to update /etc/default/docker to export the proxy setup.

 export http_proxy="http://127.0.0.1:3128/"
 export https_proxy="http://127.0.0.1:3128/"
 export HTTP_PROXY="http://127.0.0.1:3128/"
 export HTTPS_PROXY="http://127.0.0.1:3128/"

Then we restart/start docker

 sudo service docker start

Inside a container, if I run 'apt-get', npm install, bower install I cant get through the proxy.

Not sure what I m missing.

标签: docker
7条回答
疯言疯语
2楼-- · 2020-05-11 00:57

In Ubuntu 14.04 LTS:

An interesting issue about the HTTP_PROXY, HTTPS_PROXY is that: if your password has a special char like "$", "%", then it will not be processed correctly by the docker daemon when you execute command like: dock run xxx, you will encounter error. Then you can try to set the special char to others, good luck.

查看更多
登录 后发表回答