Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make docker-compose pull images using a socks5 proxy?

I use port-forwarding like this:

ssh -vND 1080 user@server_ip

Question:

How can I pull docker images with socks5?

pulling docker images with the docker pull command already has an answer here. But I want to use docker-compose for pulling images

like image 878
Phoenix Avatar asked Jan 26 '23 13:01

Phoenix


1 Answers

You can set the proxy config in the services systemd config (/etc/systemd/system/docker.service.d/http-proxy.conf):

[Service]
Environment="HTTP_PROXY=socks5://127.0.0.1:1080"

docker pull socks proxy

The service config works for docker-compose pull as well: docker-compose pull socks proxy

like image 146
masseyb Avatar answered Jan 29 '23 06:01

masseyb