R
R
Rollex2020-07-24 18:35:49
Docker
Rollex, 2020-07-24 18:35:49

How to force docker-compose to go through a proxy?

How to force docker-compose to go through a proxy?
Registered in /etc/systemd/system/docker.service.d/http-proxy.conf
and even tried in /etc/systemd/system/docker.service.d/proxy.conf

[Service]
Environment="HTTP_PROXY=http://127.0.0.1:8888"
Environment="HTTPS_PROXY=http://127.0.0.1:8888"

After of course I restart the daemon and the service
But to no avail ... I go into the container and try $wget -qO- eth0.me and it shows me my ip, not the proxy.
On off-dock, I also tried to create a .docker folder in the root profile and there the config file.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2020-07-26
@shurshur

Well, for starters, the variable for wget should be called http_proxy, not HTTP_PROXY...
Then, it's better to set it for a specific container, and not for the whole docker. If this is needed during the container build process, specify it in the Dockerfile via ARG (not via ENV).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question