How to set up HTTP proxy in docker

王林
Release: 2020-05-19 13:14:12
Original
3627 people have browsed it

How to set up HTTP proxy in docker

The method for docker to set HTTP proxy is as follows:

1. Comment out the nameserver configuration

[root@nvwa ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search apa.gad.schneider-electric.com
nameserver xx.xx.xx.xx
nameserver xx.xx.xx.xx
Copy after login

and change it to:

[root@nvwa ~]# cat /etc/resolv.conf
# Generated by NetworkManager
#search apa.gad.schneider-electric.com
#nameserver xx.xx.xx.xx
#nameserver xx.xx.xx.xx
Copy after login

2. Agent configuration

mkdir -p /etc/systemd/system/docker.service.dvi /etc/systemd/system/docker.service.d/http-proxy.conf
Copy after login

Specific configuration content

[Service]
Environment="HTTP_PROXY=http://xx.xx.xx.xx:80/
Copy after login

3. Restart docker

systemctl daemon-reload
systemctl restart docker
Copy after login

4. View the configuration results

systemctl show --property=Environment docker
Copy after login

If the following output appears, configure Success

Environment=HTTP_PROXY=http://x.xx.xx.xx:80/
Copy after login

Recommended tutorial: docker tutorial

The above is the detailed content of How to set up HTTP proxy in docker. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template