In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
In some experimental environments, the server does not have the permission to connect directly to the Internet and needs to use a network proxy; usually, the network proxy is directly configured in configuration files such as / etc/envrionment, / etc/profile and so on, which is feasible for most operations. However, these proxies cannot be used by the docker command. The most typical scenario is that docker needs to be mirrored from the public network pull.
The following recommends a method that will remain in effect after modification, overwriting the default docker.service file
1. Create an embedded systemd directory for the docker service
Mkdir-p / etc/systemd/system/docker.service.d
2. Set up the proxy
Create the / etc/systemd/system/docker.service.d/http-proxy.conf file and add the HTTP_PROXY environment variable. Where [proxy-addr] and [proxy-port] are changed to the actual proxy address and port respectively:
[Service] Environment= "HTTP_PROXY= http://[proxy-addr]:[proxy-port]/"" HTTPS_PROXY= https://[proxy-addr]:[proxy-port]/"
If there is an internal Docker registries that does not need to be accessed by a proxy, then you need to set the NO_PROXY environment variable:
[Service] Environment= "HTTP_PROXY= http://[proxy-addr]:[proxy-port]/"" HTTPS_PROXY= https://[proxy-addr]:[proxy-port]/"NO_PROXY=localhost,127.0.0.1,docker-registry.somecorporation.com"
3. Update configuration
Systemctl daemon-reload
4. Restart the Docker service
Systemctl restart docker
5. Confirm that the settings are in effect
$systemctl show-- property=Environment dockerEnvironment=HTTP_PROXY= http://proxy.example.com:80/
6. Quote
Https://docs.docker.com/engine/admin/systemd/#httphttps-proxy
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.