Docker Community Forums

Share and learn in the Docker community.

Configuring two containers networks

Looking for advice, guidance, and/or solutions (learning by example is how I learn best, so solutions preferred).

I’ve two containers:

I’m trying to spin up “kylemanna/docker-openvpn” and then spin up “fcwu/docker-ubuntu-vnc-desktop”.
The idea here is to use the openvpn container as a vpn connection while using the docker ubuntu vnc desktop container.

The first attempt I tried was running the openvpn container and then the ubuntu container, however I got stuck with choosing: Do I want the VPN to work and not be able to connect to the ubuntu container vs. Do I want the VPN to not work and be able to connect to the ubuntu container. (ubuntu container runs on localhost:6080 )

I’m stuck trying to figure out the end-to-end procedure for getting the ubuntu container to be able to connect to the vpn while also being able to connect to the localhost:6080 url.

Docker’s networking subsystem is pluggable, using drivers. Several drivers exist by default, and provide core networking functionality:

bridge: The default network driver. If you don’t specify a driver, this is the type of network you are creating. Bridge networks are usually used when your applications run in standalone containers that need to communicate. See bridge networks.

host: For standalone containers, remove network isolation between the container and the Docker host, and use the host’s networking directly. See use the host network.

overlay: Overlay networks connect multiple Docker daemons together and enable swarm services to communicate with each other. You can also use overlay networks to facilitate communication between a swarm service and a standalone container, or between two standalone containers on different Docker daemons. This strategy removes the need to do OS-level routing between these containers. See overlay networks.

macvlan: Macvlan networks allow you to assign a MAC address to a container, making it appear as a physical device on your network. The Docker daemon routes traffic to containers by their MAC addresses. Using the macvlan driver is sometimes the best choice when dealing with legacy applications that expect to be directly connected to the physical network, rather than routed through the Docker host’s network stack. See Macvlan networks.

none: For this container, disable all networking. Usually used in conjunction with a custom network driver. none is not available for swarm services. See disable container networking.

Network plugins: You can install and use third-party network plugins with Docker. These plugins are available from Docker Hub or from third-party vendors. See the vendor’s documentation for installing and using a given network plugin.