You need to add an Internet proxy in the docker configuration file.
The specific method is as follows:
1. Edit /usr/lib/systemd/system/docker.service and add the following two paragraphs
# vim /usr/lib/systemd/system/docker.service ...... Environment="HTTP_PROXY=代理url" < 追加 Environment="HTTPS_PROXY=代理url" < 追加 ......
2. Restart docker.service Service
# systemctl daemon-reload # systemctl restart docker.service
3. Finally test whether docker can connect to the Internet
# docker run -it openshift/hello-openshift
Recommended tutorial: docker tutorial
The above is the detailed content of How docker accesses the Internet through a proxy. For more information, please follow other related articles on the PHP Chinese website!