6

我一直在尝试将我的种子箱移动到 Docker 容器中,我认为我遇到了鸡/蛋问题:

当前的种子箱设置通过 privateinternetaccess.com 运行 OpenVPN(所有互联网都通过 VPN)。我有一个脚本(https://github.com/firecat53/pia_transmission_monitor),它使用 PIA 检查分配的转发端口,然后使用端口和绑定地址相应地更新传输守护进程。

问题是分配的转发端口每小时检查一次,它可以随时更改……我需要在运行 Docker 容器之前知道端口,这样我就知道哪些端口要通过/从容器传递。我也打算在容器内运行 OpenVPN,但在事先不知道分配给容器的端口的情况下,我不确定这是否可行。

一个非常老套的解决方案可能是在一个容器内运行 OpenVPN 和另一个 Docker 守护程序,然后在 OpenVPN 容器内运行传输容器。这似乎很复杂,所以我还没有真正尝试过。

我在这里错过了一些非常明显的东西吗?还有其他想法吗?

谢谢!

斯科特

4

4 回答 4

2

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.

于 2014-04-25T21:07:04.953 回答
0
于 2014-01-13T18:04:58.700 回答
0

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

于 2014-02-20T05:54:58.257 回答
0

Something worth checking out along some of the same lines, though missing the vpn portion, which is nice btw. When the cycles arise I think someone will add it.

https://github.com/Ohge/Docker-TransHeadCouchRage

于 2015-07-09T17:50:18.590 回答