Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure HTTP and HTTPS agents in Docker

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

In this issue, the editor will bring you about how to configure HTTP and HTTPS agents in Docker. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Start configuration

1. Create a directory for the following path

Sudo mkdir-p / etc/systemd/system/docker.service.d

2. Go to the directory created in the previous step, and create a file named http-proxy.conf (such as / etc/systemd/system/docker.service.d/http-proxy.conf) in this directory. Edit the file using vim as follows

[Service] Environment= "HTTPS_PROXY= http://127.0.0.1:1080/"" NO_PROXY=localhost,127.0.0.1,registry.docker-cn.com,hub-mirror.c.163.com "

3. Refresh the configuration

Sudo systemctl daemon-reload

4. Restart the Docker service

Sudo systemctl restart docker

5. View the configuration

Systemctl show-property=Environment docker

The following message indicates that the configuration is successful:

Environment=HTTPS_PROXY= http://127.0.0.1:1080/ NO_PROXY=localhost,127.0.0.1,registry.docker-cn.com,hub-mirror.c.163.com

6. Verify whether the configuration is effective.

Pull the elasticsearch image from docker.elastic.co again, and you can connect normally at this time, but the speed is slow.

Liuwei@liuwei-Ubuntu:~$ sudo docker pull docker.elastic.co/elasticsearch/elasticsearch:6.2.4

6.2.4: Pulling from elasticsearch/elasticsearch

469cfcc7a4b3: Downloading [= >] 38.87MB/73.17MB

8e27facfa9e0: Downloading [= >] 40.05MB/56.33MB

Cdd15392adc7: Download complete

Ddcc70fbd933: Downloading [= >] 44.31MB/108.9MB

3d3fa0383994: Waiting

15d1376ebd55: Waiting

The above is the editor to share with you how to configure HTTP and HTTPS agents in Docker. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report