Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please add support for socks5 proxy #5989

Closed
yunfan opened this issue May 22, 2014 · 41 comments
Closed

please add support for socks5 proxy #5989

yunfan opened this issue May 22, 2014 · 41 comments
Labels
area/networking kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny

Comments

@yunfan
Copy link

yunfan commented May 22, 2014

hi, i live behind the GFW, and unfortunately the cdn-registry-1 has been block at my location.

i hope you could add support for socks5 proxy , i knew you have HTTP_PROXY support,

but i think socks5 proxy are more popular and convenient, cause everyone could simply use ssh user@host -D 9999 to launch a simple proxy server at once

@absolute8511
Copy link

+1, We need this too

@shuaiming
Copy link

+10086 , i got this fucking gfw problems too...

@jessfraz jessfraz added /system/networking kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny labels Feb 26, 2015
@gaolei-gl
Copy link

+1
That would be very useful.

@thaJeztah
Copy link
Member

Just linking in case it's useful; another issue related to GFW; #11093 (possibly useful tip as well here: #11093 (comment))

@GeorgeZhai
Copy link

+1
Thanks

@94Bo
Copy link

94Bo commented May 28, 2015

+12306

@utyagi24
Copy link

utyagi24 commented Jun 4, 2015

+1 #$%$!

@win-t
Copy link

win-t commented Jun 13, 2015

+1,
I need this,

Thanks

@RomainSF
Copy link

RomainSF commented Jul 3, 2015

+6

@VPaulV
Copy link

VPaulV commented Jul 27, 2015

+1
Thank you.

@ghost
Copy link

ghost commented Jul 30, 2015

+1
I have a Systemd unit file in place for permanent SSH tunnel that I would like to be used by Docker.

@thaJeztah
Copy link
Member

@usertaken perhaps you are interested in creating a PR to describe this? Thinking of an extra section in https://github.com/docker/docker/blob/master/docs/articles/systemd.md (similar to the proxy example/section)?

@smiller171
Copy link

👍

@GordonTheTurtle
Copy link

USER POLL

The best way to get notified when there are changes in this discussion is by clicking the Subscribe button in the top right.

The people listed below have appreciated your meaningfull discussion with a random +1:

@uzxmx
@pstinghua
@intothephone
@h12w

@raintean
Copy link

+1

@edx903
Copy link

edx903 commented Oct 20, 2015

+1
desire for freedom

@gitchs
Copy link

gitchs commented Nov 12, 2015

+1

@curtiszimmerman
Copy link

+1 this machine could kill fascists.

@shinigami1992
Copy link

+1

1 similar comment
@bluesalt
Copy link

+1

@gaocegege
Copy link
Contributor

It's useful!

@nathanleclaire
Copy link
Contributor

Submitted a PR to support this: #18373

Try it out!

@smiller171
Copy link

thanks @nathanleclaire !

@KellerFuchs
Copy link

@nathanleclaire Awesome.
I will give it a spin and check for on-network leakage (I plan to use it over Tor); does it avoid doing DNS queries?

@nathanleclaire
Copy link
Contributor

@KellerFuchs I'm not 100% sure. My PR routes the requests from the Docker client to the Docker API through the SOCKS proxy by controlling the low-level net.Dial, so I would expect that if there were a DNS lookup as part of that (e.g. if you request API at host.mydomain.com:2376) it should go through the proxy as well. However, I'm not an expert on networking and any analysis of leakage is encouraged.

@nathanleclaire
Copy link
Contributor

@KellerFuchs I think actually it will not route DNS requests, because the Golang Dialer does not support socks5h so far, just socks5. I've filed an issue here: golang/go#13454

@KellerFuchs
Copy link

Awesome, thanks.

@cpuguy83
Copy link
Member

Closed by #20366

@samos123
Copy link

samos123 commented Apr 2, 2016

@cpuguy83 could you tell how we enable socks5 proxies? I saw that you closed the ticket but didn't find any reference to docs or configurations on how to enable here nor in #20366 . Thanks!

@nathanleclaire
Copy link
Contributor

@samos123 Use http_proxy / https_proxy environment variable, along the lines of:

$ HTTP_PROXY=socks5://localhost:5000 docker info

@xbaran
Copy link

xbaran commented Apr 11, 2016

+1

@cpuguy83
Copy link
Member

@xbaran +1 for what? This is already added.

@thaJeztah
Copy link
Member

@xbaran adding "+1" doesn't help, this is already implemented for 1.11; see #20366

edit: oops, see @cpuguy83 just commented the same

@tom-bowles
Copy link

Setting the environment variable for the execution of the docker command line utility, as described by @nathanleclaire, doesn't appear to work. I had to add it to the docker daemon.

@nathanleclaire
Copy link
Contributor

HTTP_PROXY and ALL_PROXY, if set where the docker client executable is invoked will dictate how the client attempts to contact the server (docker daemon). As you noted, if you need a proxy for image pulls, etc., you have to configure the daemon's environment to support this.

@windowsair
Copy link

How to use it in image? For example use it in "docker run centos: latest"@nathanleclaire

@nathanleclaire
Copy link
Contributor

@windowsair You can't configure it in an image level setting, it's something that gets set to dictate the behavior of the docker CLI client.

@smiller171
Copy link

@nathanleclaire couldn't you do $ HTTP_PROXY=socks5://localhost:5000 docker run centos:latest to get it to pull that one image from the right host? You could then utilize aliases if you need to do that frequently I think

@nathanleclaire
Copy link
Contributor

@smiller171 If you mean will HTTP_PROXY=<authority> docker pull pull the image through that proxy, then no, it won't. (Unless the code is doing something excessively clever since last time I was there)

The Docker daemon pulls the images. The Docker client (the binary you are invoking when you type docker run, docker pull, etc.) will send requests to the Docker daemon to indicate what actions should be taken. Those API (HTTP-ish) requests will be routed / proxied according to the environment variables set where it is invoked but the Docker daemon has its own settings. See https://docs.docker.com/engine/admin/systemd/ for info how to configure.

@windowsair
Copy link

windowsair commented Dec 2, 2017

@nathanleclaire
Thanks a lot! But I feel the existing document is very confusing. I still do not know how to configure the socks proxy for the running container.

@smiller171
Copy link

@windowsair You're asking about the traffic from the container going over the proxy? AFAIK this would need to be configured either in the container, or configuring a Docker network that forces all traffic over the proxy.

These settings are for configuring how the client talks to the daemon, or how the daemon talks to the registry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny
Projects
None yet
Development

No branches or pull requests