Docker-transmission-openvpn: Running another application (MLDonkey) inside the container under the VPN

Created on 12 Dec 2018  路  3Comments  路  Source: haugene/docker-transmission-openvpn

I would really like to have another application inside the container so that it can use the advantages of being under the vpn. I was thinking about MLDonkey.
I built the container with the default Dockerfile but adding to the end the content taken from this other container -> https://github.com/AngeleToR/docker-mldonkey
Everything works but I can see that MLDonkey is not under vpn because the ip is my public one and I can access from outside.
Do you know if there is an easy way to do what I am trying to do?
Thank you very much in advance.

Most helpful comment

I confirm that is working. I was not expecting to be such easy. Thank you for your fast reply.

All 3 comments

There is :) You can have containers use the networking of other containers. See:
https://docs.docker.com/engine/reference/run/#network-settings

With the network set to container a container will share the network stack of another container. The other container鈥檚 name must be provided in the format of --network container:.

If the container exposes some ports/web ui, these ports needs to be added to the vpn container instead as it's the one that controls the network. In this mode the two containers can not run processes on the same port as they would collide (as opposed to two regular containers where this would work as long as you bind them to different host ports)

So just to be clear. You shouldn't need to modify the other image. Just run it with --network container:<id|name> and add the port binds to the vpn container.

I confirm that is working. I was not expecting to be such easy. Thank you for your fast reply.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

callahan22 picture callahan22  路  4Comments

Moose88 picture Moose88  路  4Comments

silentArtifact picture silentArtifact  路  3Comments

jorgelsaba picture jorgelsaba  路  3Comments

beneix picture beneix  路  3Comments