Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transmission-daemon inside Docker container with OpenVPN/privateinternetaccess.com port forwarding [closed]

I've been experimenting with moving my seedbox into a Docker container and I think I'm up against a chicken/egg problem:

The current seedbox setup has OpenVPN running (all internet goes through the VPN) through privateinternetaccess.com. I have a script (https://github.com/firecat53/pia_transmission_monitor) that checks with PIA for the assigned forwarded port and then updates transmission-daemon accordingly with the port and bind address.

The problem is that the assigned forwarded port is checked hourly and it can change at any time...and I need to know the port before running the Docker container so I know which ports to pass through to/from the container. I was intending to run OpenVPN inside the container as well, but without knowing in advance which port to assign to the container I'm not sure this is going to work.

A very hackish solution could be to run OpenVPN and another Docker daemon inside one container, then run the transmission container inside the OpenVPN container. This seems waay to complex though so I haven't actually tried it yet.

Am I missing something really obvious here? Any other ideas?

Thanks!

Scott

like image 504
Scott Hansen Avatar asked Jan 12 '14 19:01

Scott Hansen


1 Answers

I finally managed to get Transmission-daemon running inside the Docker container through an OpenVPN connection to Privateinternetaccess.com.

Here is the Dockerfile and the various configuration files and scripts needed to make this work. I'm open to any simplifications and/or alternate ways of achieving this! Some notes:

  1. OpenVPN requires running the container with the --privileged flag in order to create the tun0 connection.

  2. I could only make it work right by using Pipework along with a bridge on the host to give the container it's own IP address on the network.

like image 167
Scott Hansen Avatar answered Sep 17 '22 06:09

Scott Hansen