HTTP proxy configuration for Docker on CentOS 7

From Notes_Wiki
Revision as of 08:55, 25 August 2022 by Saurabh (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Home > CentOS > CentOS 7.x > Virtualization > Docker ? HTTP proxy configuration for Docker on CentOS 7

On CentOS7 if docker is behind a proxy server then use following steps:

  1. Create folder for configuring docker service through systemd
    mkdir /etc/systemd/system/docker.service.d
  2. Create service configuration file at /etc/systemd/system/docker.service.d/http-proxy.conf
    [Service]
    Environment="HTTP_PROXY=http://proxy.iiit.ac.in:8080/" "NO_PROXY=localhost,127.0.0.0/8,10.0.0.0/8,192.168.0.0/16,172.16.0.0/12"
  3. Reload systemctl so that new settings are read
    sudo systemctl daemon-reload
  4. Verify that docker service Environment is properly set
    sudo systemctl show docker --property Environment
  5. Restart docker service so that it uses updated Environment settings
    sudo systemctl restart docker

Learned from https://docs.docker.com/articles/systemd/


Home > CentOS > CentOS 7.x > Virtualization > Docker ? HTTP proxy configuration for Docker on CentOS 7