Usually, running a command of the form
export http_proxy/https_proxyon the host is enough to set a Proxy. However, settings on the host do not take effect inside containers. Below are several configuration approaches.
1. Configure Docker’s proxy - Node level
Configure this on the node that needs the Proxy. Docker is used as the example below:
- Create the configuration file
| |
- Edit the configuration file and set the proxy
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"
Environment="HTTPS_PROXY=https://proxy.example.com:443/"
Environment="NO_PROXY=localhost,127.0.0.1"
- Restart Docker
| |
2. Configure Proxy in containers - Container level
Configure this in the container that needs the Proxy.
| |
