How to use HTTP/HTTPS proxy inside Pi-hole Docker container (network restrictions in China)

Hi everyone,

When running Pi-hole inside Docker, I encountered errors when the container tries to fetch from GitHub:

fatal: unable to access 'https://github.com/pi-hole/pi-hole/': Failed to connect to github.com port 443 after 2938 ms: Could not connect to server
fatal: unable to access 'https://github.com/pi-hole/web/': Failed to connect to github.com port 443 after 949 ms: Could not connect to server
fatal: unable to access 'https://github.com/pi-hole/FTL/': Failed to connect to github.com port 443 after 945 ms: Could not connect to server

I am located in China, where accessing GitHub directly is often unreliable. Normally, we solve this issue by setting an HTTP/HTTPS proxy.

I tried setting the following environment variables when running the container:

environment:
  - http_proxy=http://my-proxy:port
  - https_proxy=http://my-proxy:port
  - no_proxy=localhost,127.0.0.1

But Pi-hole services inside the container (e.g., FTL update scripts, git commands) still fail to use the proxy.

Questions:

  1. Is there a supported way to configure Pi-hole Docker so that all outbound traffic (especially git clone / git fetch during updates) goes through a proxy?

  2. Do I need to configure proxy variables somewhere inside the container (e.g., /etc/environment, git global config), or should the docker run -e http_proxy approach already work?

  3. Is there any known limitation with Pi-hole services ignoring proxy settings?

Thanks a lot!

This is not a Pi-hole configuration. It is a docker configuration.