Skip to content

Instantly share code, notes, and snippets.

@entron
Forked from alphamarket/http-proxy.conf.md
Last active August 22, 2024 13:51
Show Gist options
  • Save entron/92955d5a18c449192f7bb6a46e4bb858 to your computer and use it in GitHub Desktop.
Save entron/92955d5a18c449192f7bb6a46e4bb858 to your computer and use it in GitHub Desktop.
How to make docker pull using a socks5 proxy

Create the config file:

mkdir -p /etc/systemd/system/docker.service.d && \
vi /etc/systemd/system/docker.service.d/http-proxy.conf

Put up the configs:

[Service]
Environment="HTTP_PROXY=socks5://127.0.0.1:8080"
Environment="HTTPS_PROXY=socks5://127.0.0.1:8080"

Flush changes:

sudo systemctl daemon-reload

Verify that the configuration has been loaded:

sudo systemctl show --property Environment docker

Restart Docker:

sudo systemctl restart docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment