Openvpn client

This image does nothing but create a vpn tunnel. It will be used by other containers to encrypt traffic.

Dockerfile

FROM fedora:22
MAINTAINER zews@zews.org

RUN     dnf -y update && dnf -y install openvpn
RUN     dnf clean all


VOLUME ["/config"]

ENTRYPOINT ["openvpn"]

CMD ["--config", "/config/openvpn.conf"]

Run command

docker run -d --privileged --name=openvpn -v /path/to/your/configs:/config localhost/openvpn

Sharing this network

To use this network run your container command like: docker run --net=container:openvpn -d some/image

Port forwarding

Since your second container is using the network of the openvpn container all ports must be exposed and mapped from the openvpn container.

Web servers will require a proxy since you are probably not considered local to the container running openvpn.