Docker : Installing Docker behind a proxy on CentOS 7 : Error while pulling image

Hi,

CentOS changed their init system to systemd starting with CentOS 7, so the config files that override defaults are not in the same place as version 6. For proxy settings, try this:

  • I’ll assume you followed the directions here: Install Docker Engine on CentOS | Docker Docs

  • Create the folder: /etc/systemd/system/docker.service.d/

  • Within that folder, create http-proxy.conf (so, your full file path is /etc/systemd/system/docker.service.d/http-proxy.conf) with the following format:
    [Service]
    Environment=“HTTP_PROXY=”

  • Now, you need to restart the service. With systemd, this is done as:

    systemctl daemon-reload
    systemctl restart docker

  • Now try ‘docker run hello-world’ and the proxy should be used for the image download.

3 Likes