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

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


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.


Would it help to set the Docker-assigned port with -p <publicport>:<containerport>?

E.g., assuming that transmission listens on port 10000 inside the container, you could tell Docker "hey, expose that on port 1234, will you?" by doing docker run -p 1234:10000 …


I would look for a generic socket proxy that could copy all traffic to/from the dynamically-assigned port to one that you statically use. E.g.

$ docker run -p 1000 your_container /bin/bash# PORT=$(pia_setup_script)# proxy_command 1000 $PORT

Of course you can make this more elegant, but that's the general concept