How to Force Docker Through Proxy


Recommended Posts

I have been using Unraid for about 1 year now and been able to replace everything I did on Windows 10 with dockers for the most part. Some of the very specific things was running Firefox docker on a VPN only connection, as well as a Jdownloader docker. I do this by using binhex-delugevpn and connecting via the proxy server. It works amazing and have never had a problem. Connecting to a proxy server in these dockers is easy as the each have proxy settings within them.

 

But 2 other dockers I would like to run through this proxy server is the youtube-dl-gui docker and a docker from dockerhub (a deezloader docker). I have little to no experience with command line/linux which is why I chose unraid. I realize this is a very specific problem and have found no information on if this is possible and how to do it if it is. I did try spaceinvaders video of how to create a proxy server with an ubuntu installation, but it basically only creates a proxy server on a VPN, which is what I already have. Any help would be appreciated.

 

tldr: how can you force a docker to run through a proxy server

Link to comment

That's what I was afraid of. I couldn't be the first person to need this. The only information I could find was modifying the main docker engine to route all traffic (I doubt it would work on unraid anyway as the proxy server is part of the docker apps), but I only need it on specific dockers. I was hoping there was a way to create like a virtual network interface, route the traffic for that through the proxy and connect the docker to that virtual network. Not very linux savy so don't really know much about any of this.

Link to comment
3 hours ago, Matrix said:

But 2 other dockers I would like to run through this proxy server is the youtube-dl-gui docker and a docker from dockerhub (a deezloader docker).

 

tldr: how can you force a docker to run through a proxy server

Hey, (warning this is not a fully formed thought, but..), you can force applications that don't have proxy capabilities to use a proxy by setting up a transparent proxy.  I'd have a read up on that, it could be an option added to the deluge-vpn docker depending on what that uses.  In the days of slow connections I set this up using squid a few times.  Maybe it helps. :D

Link to comment
2 hours ago, Matrix said:

I was hoping there was a way to create like a virtual network interface, route the traffic for that through the proxy and connect the docker to that virtual network. Not very linux savy so don't really know much about any of this.

That was one of the "overly complicated" workaround I was thinking of.

Link to comment

Yeah, I'd combine the transparent proxy and probably an extra vlan that routes the whole vlan through that proxy.  Should be possible.  Thinking that through, if you have a semi-decent firewall you could actually do this on the firewall.  That would have the advantage of being available to the whole network and not having to configure proxy's on anything (just e.g. choose the relevant network).  Not as simple as the vpn docker container you've got though.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.