This document outlines steps to configure an HTTP proxy for Docker to pull the streaming client image from Dockerhub.
Configure the Docker Daemon’s environment variables via systemd, which manages the service lifecycle.
The commands might need sudo access, this article includes commands with and without sudo access.
Reference
Source: https://docs.docker.com/engine/daemon/proxy/#systemd-unit-file
When docker is running as a service, the proxy configuration is defined in /etc/systemd/system/docker.service.d/http-proxy.conf
The format of this file should look like:
[Service] Environment="HTTP_PROXY=http://<proxy_host>:<proxy_port>" Environment="HTTPS_PROXY=http://<proxy_host>:<proxy_port>" Environment="NO_PROXY=localhost,127.0.0.1,registry.internal.corp"
Verify Existing Configuration
Use cat /etc/systemd/system/docker.service.d/http-proxy.conf
or sudo cat /etc/systemd/system/docker.service.d/http-proxy.conf to review the content.
- if the folder or file doesn’t exist, or if the file is empty then no proxy is used
- if the file has existing content, please review it
Create or Edit Docker Proxy Configuration
- If the folder is missing, please create it with
mkdir -p /etc/systemd/system/docker.service.d
orsudo mkdir -p /etc/systemd/system/docker.service.d - To define the file content please use a text editor like
vi:vi /etc/systemd/system/docker.service.d/http-proxy.conforsudo vi /etc/systemd/system/docker.service.d/http-proxy.conf - For example, to use Netskope EPoT, use the following content
[Service] Environment="HTTP_PROXY=http://163.116.128.80:80" Environment="HTTPS_PROXY=http://163.116.128.80:80"
4. Reload Systemd and Restart Docker to apply the configuration.
systemctl daemon-reload systemctl restart docker
or
sudo systemctl daemon-reload sudo systemctl restart docker

