Docker Proxy for daemon and client

DOCKER DEAMON PROXY

  • systemd level

/etc/systemd/system/docker.service.d/https-proxy.conf

[Service]
Environment="http_proxy=http://127.0.0.1:8123" "https_proxy=https://127.0.0.1:8123" "NO_PROXY=registry-1.docker.io"
sudo systemctl daemon-reload
sudo systemctl restart docker
  • service level

/etc/default/docker

export http_proxy="http://127.0.0.1:3128/"
  • daemon level

/etc/docker/daemon

DOCKER CLIENT PROXY

~/.docker/config.json

       "proxies":{
                "default":{}
        }

Related