Docker Externally Routable Containers

230 views Asked by At

How do I create externally routable docker containers on a single VM?

Here's my predicament... I'm trying to set up 1..n containers running on an Ubuntu 16.04 VM that are provided a unique externally routable IP address and that allows each container to listen on the same ports (avoid port conflicts on host).

I've already gone down the route of adding IP addresses to the NIC and then assigning them to the individual containers, which works, but is a fairly cumbersome solution. I've also tried implementing a MACVlan Docker network thinking it would solve this problem, but none of the containers can reach outside the network (i.e. cannot ping between container and another Virtual Machine). From what I read regarding MACVlan, I understand that the containers cannot talk to the host, but I thought they would be able to reach out to other systems on the same subnet/network. Using MACVLan, the containers can talk with each other though.

Does anyone have a possible solution to the sort of implementation I'm looking for or am I stuck adding IP addresses to the VM's NIC?

0

There are 0 answers