Docker "Network Type" of another container


Recommended Posts

Would be great to be able to specify a different docker container for the "Network Type" natively, where a docker container is using:

--cap-add=NET_ADMIN --device /dev/net/tun

config-vpn.thumb.png.6b1b82ad62ea4107744e70618eded977.png

 

A use case for this is as follows:

I have a VPN Client Docker (dperson/openvpn-client) [called "vpn"] that's permanently connected to my VPN provider (PIA in my case)

I then have 2 dockers which tunnel their network through that container (jackett and qbittorrent)

 

config-client.thumb.png.90785015491ed5da9aa0723a46e56227.png

 

At present I have come up with a bit of a hack after lots of messing around where I set the 2 dependent containers Network Types to "None", then add into "Extra Parameters":

--net=container:vpn

Hopefully this could include a UI update that would use the containers name instead of the UID too

main-screen.thumb.png.d315873ec53854e9fb883d7597ebc128.png

 

 

I know what I have done is probably massively hacky, but I couldn't get it to work how I desired any other way. I did not want the VPN at the server level, as that interferes with things like Plex remove services, etc. And hey, I'm a developer; sometimes the solution is just "I need to get this to work, It don't need to be pretty".

  • Like 1
  • Upvote 1
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.