How to configure Docker Proxy on CentOS 7, RHEL 7

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

Leave a Reply

Name *
Email *
Website

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