Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker pull ignores http_proxy and https_proxy environment variables?

Tags:

docker

proxy

It looks like docker pull <image> ignore the http_proxy and https_proxy environment variables. I want to intercept the communication in order to better understand which HTTP requests docker pull performs - is there a way to look at them?

I'm executing docker pull on Ubuntu 18.

like image 659
D.R. Avatar asked Sep 20 '25 05:09

D.R.


1 Answers

at least in my case the solution above didn't work for me as my environment was controlling docker with systemd

In summary:

  1. Create a file named /etc/systemd/system/docker.service.d/http-proxy.conf

  2. Populate the file. Sample:

    [Service]
    Environment="HTTP_PROXY=http://proxy.example.com:80"
    Environment="HTTPS_PROXY=https://proxy.example.com:443"
    Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"
    
  3. sudo systemctl daemon-reload and sudo systemctl restart docker

Proxy specific information: https://docs.docker.com/config/daemon/systemd/#httphttps-proxy

like image 183
user2987504 Avatar answered Sep 22 '25 21:09

user2987504