Docker setup proxy

The Docker proxy needs to be set when it starts the service. The proxy set by the terminal will not take effect when the docker command is executed.

The correct setting is as follows:

# systemctl stop docker
# vim /lib/systemd/system/docker.service

Add the Environment variable under the Service section and configure it as your own proxy address , as follows

[Service]

Environment="HTTP_PROXY=http://[proxy-addr]:[proxy-port]/" "HTTPS_PROXY=https://[proxy-addr]:[proxy-port]/"

restart docker

# systemctl daemon-reload
# systemctl start docker

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325853195&siteId=291194637