Lionel Blog

The road is under your feet, the heart looks to the distance

Ubuntu

Docker에서 HTTP 프록시 설정

sudo /etc/default/docker

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/"

설정 로드 및 Docker 재시작

sudo service docker restart

CentOS

Docker에서 HTTP 프록시 설정

sudo mkdir -p /etc/systemd/system/docker.service.d

echo '
[Service]
Environment="HTTP_PROXY=http://proxy.foo.bar.com:80/"
' | sudo tee /etc/systemd/system/docker.service.d/http-proxy.conf

설정 로드 및 Docker 재시작

sudo systemctl daemon-reload
sudo systemctl restart docker