How to configure Docker Proxy on CentOS 7, RHEL 7

May 25, 2018 Linux, Virtualization

How to enable Proxy for Docker engine with or without authentication on CentOS 7, Red Hat Enterprise Linux 7?


Steps:

1. Edit Docker configuration file

Edit /etc/sysconfig/docker file and add the below code at the bottom:

a) using authentication

HTTP_PROXY=http://username:password@85.254.112.20:8080/
HTTPS_PROXY=https://username:password@85.254.112.20:8080/
NO_PROXY= host.tuxfixer.com,192.168.2.24

b) without authentication

HTTP_PROXY=http://85.254.112.20:8080/
HTTPS_PROXY=https://85.254.112.20:8080/
NO_PROXY= host.tuxfixer.com,192.168.2.24

2. Restart Docker engine

Don’t forget to restart Docker daemon in order for the changes to take effect:

[root@tuxfixer ~]# systemctl restart docker

One thought on “How to configure Docker Proxy on CentOS 7, RHEL 7”
  1. Hello,

    if using systemd there also an another option: using an service file in /etc/systemd/system/docker.service.d/

    # /etc/systemd/system/docker.service.d/http-proxy.conf
    [Service]
    Environment=”HTTP_PROXY=http://85.254.112.20:8080/”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.