Hi,
I believe you are one step from what you are trying to achieve. Using network_mode: host
lets you manipulate the host OS’s network stack from within the container so starting an OpenVPN client within such container will actually create the connection on the host. Basically what you need to do is
- Switch all containers in your docker-compose to host networking
- Run the OpenVPN client within one of the containers (I believe it also needs to either be privileged or have the
NET_ADMIN
capability to create the network interface)
If the OpenVPN client within the container creates a connection this one should be available on the host OS and all the containers as well.
Please let us know whether this is what you were looking for.