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="ALL_PROXY=socks5h://127.0.0.1:1080"
Environment="HTTP_PROXY=socks5h://127.0.0.1:1080"
Environment="HTTPS_PROXY=socks5h://127.0.0.1:1080"
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
Hello, I'm running Docker Engine - Community 26.1.3 on Ubuntu 22.04. I used dante-server 1.4.2 as a SOCKS proxy. It is listening on 127.0.0.1:1080. Using the proxy in Docker works perfectly when I set it up as
socks5://127.0.0.1:1080
, but when I switch tosocks5h://127.0.0.1:1080
I get the following error when pulling images.This is the output of
tcpdump -i any -n port 53
after runningdocker pull hello-world
. Seems like it is usingsocks5h
as the hostname of a machine, whereas the hostname is completely different.