大网数据广告活动
服务器运维问答

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

· 52CE 我爱测

I'm trying to pull images through a socks5 proxy. I've started the socks5 proxy on port 8888 like this: ssh -NC -D 8888 parham@***.***.** However, when I run docker-compose like this, it is evident that it's not using the environ…

问题原文

原帖链接 · Parham Doustdar · CC BY-SA 3.0

I'm trying to pull images through a socks5 proxy. I've started the socks5 proxy on port 8888 like this:

ssh -NC -D 8888 parham@***.***.**

However, when I run docker-compose like this, it is evident that it's not using the environment variable:

$ ALL_PROXY=socks5://127.0.0.1:8888 docker-compose up

How can I make Docker pull images through this proxy?

已采纳解答

原帖链接 · nikhilweee · CC BY-SA 3.0

Looks like this feature has been recently added to docker, particularly in version 1.11.0. Though there isn't enough documentation about its usage, setting the ALL_PROXY environment variable should work, according to this comment.

$ export ALL_PROXY=socks5://localhost:port 
$ docker pull image

I'm not sure about docker-compose at the moment. If your primary aim is to speed up the download process using socks5, you might be able to achieve the purpose by manually pulling images using docker pull before finally running docker-compose up.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-11-28)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。