docker / roadmap

Welcome to the Public Roadmap for All Things Docker! We welcome your ideas.
https://github.com/docker/roadmap/projects/1
Creative Commons Zero v1.0 Universal
1.45k stars 246 forks source link

socks5 proxy support for Docker Desktop #100

Closed fizbin closed 1 month ago

fizbin commented 4 years ago

Tell us about your request Since Docker on linux supports socks5 proxies since at least 2017 (by setting the environment variable https_proxy to something like socks5://127.0.0.1:1099) it would be nice if Docker Desktop allowed specifying socks5 proxies by saying socks5://127.0.0.1:1099 in the "Manual Proxy Configuration" UI.

Which service(s) is this request for? Docker Desktop for Mac. I don't use Windows, so I don't know whether it's needed there too.

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? Sometimes I wish to pull from a docker repo. that is only accessible from a group of machines that I can ssh to, but not directly network-accessible to me. When that's the case, on my linux desktop I can do ssh -D 1099 -fCqN jumpbox, then set https_proxy as above and I'm able to use docker login and docker pull on that repo to get what I want.

Sometimes though I'm not at my Linux desktop, and just have my Mac laptop. Although I could just ssh into the linux desktop and work there, I'd like to use docker locally. (e.g. when travelling, back in the pre-COVID-19 time when people could travel)

Are you currently working around the issue? What I have to do currently is start an https proxy on the jumpbox machine and use ssh to forward that specific port with something like ssh -nC -L 3128:localhost:5502 jumpbox python simple_proxy.py 5502 and then set docker desktop to do use http://localhost:3128 as its https proxy.

Additional context Based on some digging that people did for the docker-for-mac bug report https://github.com/docker/for-mac/issues/1238, I suspect that part of what's happening currently is logic that looks like this:

And similarly for an https proxy. This leaves the docker running inside qemu thinking that it has an http proxy to talk to. Instead, I'd like to propose that docker use logic like this:

(and similar logic for the https proxy)

bbaksa commented 4 years ago

Can we change this Title for "socks5 proxy support for Docker"? ...this issue is not related only for MAC, it exists on Linux and Windows platforms also. In general, in every laboratory, or on enterprise intranet, where no any internet access only trough SOCKS5 proxy, this SOCKS5 proxy can be use only, but if it is not supported...

fizbin commented 3 years ago

@bbaksa Docker for Linux has socks5 support. (this difference in support between Linux and platforms covered by Docker Desktop was part of the motivation for the original ticket)

If Docker Desktop for Windows similarly does not support socks5 (I don't use Windows, so don't know), then changing the title to "socks5 proxy support for Docker Desktop" makes sense.

bbaksa commented 3 years ago

@fizbin Hmmm, when I tried, it wasn't work for me, only with the workaround to create a proxy server on localhost.

marcofranssen commented 3 years ago

I'm in the need for this as well to be able to reach some company internal servers from my Docker application. It works from my webbrowser and my Golang application natively on my Mac, but it doesn't work from my Docker container.

dexhunter commented 3 years ago

Yep, please support socks5 proxy. It is crucial for survival in mainland China. Thanks!

blevine commented 3 years ago

Also just figured out that this is not yet supported. Must have!

marcofranssen commented 3 years ago

Any feedback on this one @412PIT?

its0xFUL commented 2 years ago

This feature is necessary for my work, would very much appreciate it being worked on.

mattghali commented 2 years ago

Please, for the love of god support this; aren't you expecting us to pay for this now?

mkt95 commented 2 years ago

The lack of support for SOCKS5 proxies is high on the list of blockers from our company adopting Docker Desktop for dev workstations.

sg552 commented 2 years ago

Hi, I met this problem and spent hours on this issue ( socks5 proxy), I am using Win10, docker .

to resolve this, refer to: https://superuser.com/questions/423563/convert-http-requests-to-socks5

$ pip3 install pproxy
# assuming your socks5 proxy running at 127.0.0.1:9150 
$ pproxy -r socks5://127.0.0.1:9150 -vv    

then you will get an http proxy running at localhost:8080

then in your docker , set these variables: ( assuming your host ip is 192.168.10.3)

export HTTP_PROXY="http://192.168.10.3:8080"
export HTTPS_PROXY="http://192.168.10.3:8080"
export http_proxy="http://192.168.10.3:8080"
export https_proxy="http://192.168.10.3:8080"

image

ahmedalnuaimi commented 1 year ago

Hi, I met this problem and spent hours on this issue ( socks5 proxy), I am using Win10, docker .

to resolve this, refer to: https://superuser.com/questions/423563/convert-http-requests-to-socks5

$ pip3 install pproxy
# assuming your socks5 proxy running at 127.0.0.1:9150 
$ pproxy -r socks5://127.0.0.1:9150 -vv    

then you will get an http proxy running at localhost:8080

then in your docker , set these variables: ( assuming your host ip is 192.168.10.3)

export HTTP_PROXY="http://192.168.10.3:8080"
export HTTPS_PROXY="http://192.168.10.3:8080"
export http_proxy="http://192.168.10.3:8080"
export https_proxy="http://192.168.10.3:8080"

image

Worked for me thanks a lot!

munkyboy commented 11 months ago

Hi, I met this problem and spent hours on this issue ( socks5 proxy), I am using Win10, docker .

to resolve this, refer to: https://superuser.com/questions/423563/convert-http-requests-to-socks5

$ pip3 install pproxy
# assuming your socks5 proxy running at 127.0.0.1:9150 
$ pproxy -r socks5://127.0.0.1:9150 -vv    

then you will get an http proxy running at localhost:8080

then in your docker , set these variables: ( assuming your host ip is 192.168.10.3)

export HTTP_PROXY="http://192.168.10.3:8080"
export HTTPS_PROXY="http://192.168.10.3:8080"
export http_proxy="http://192.168.10.3:8080"
export https_proxy="http://192.168.10.3:8080"

Thanks for this tip! To help avoid unwanted access to your proxy, I would configure pproxy to only listen on localhost, then you can use the special DNS entry host.docker.internal. So something like:

pproxy -r socks5://127.0.0.1:9150 -l http://127.0.0.1:8080
docker run -e HTTPS_PROXY=http://host.docker.internal:8080 ...
aihua commented 7 months ago

How soon will be released the feature supported to socks 5 proxy for Docker Desktop? Any schedules? @christophermclellan @bryansh

djs55 commented 3 months ago

Hi, I have created a prototype development build if you'd like to give it a try:

The SOCKS feature is listed in the "Beta" features and should be enabled: image

Afterwards it should be possible to manually set proxy URLs to socks5://host:port.

Let me know what you think!

alexcriss commented 3 months ago

I tested the prototype and it works great for me ❤️

bryansh commented 1 month ago

Good news! This is a beta feature that shipped with Docker Desktop 4.28.

To enable: Settings -> Features in Development -> Enable Socks5 proxy support