Docker Community Forums

Share and learn in the Docker community.

Moving from VMs to Docker, how to handle IPs when moving a container across physical servers?


(Sprior) #1

I’ve got 3 virtualization servers at home for my personal education, and services like MySQL, web server, postfix, Jenkins, home automation server all all running in their own VMs with bridged network connections so they all appear as if they were real machines on my network. If I move a VM from one virtualization server to another nothing really changes because the IP addresses stay the same - my pfSense router forwards external ports to the appropriate internal IP address of the VM serving that function.

I’m trying to understand how I’d create the next generation of this system in a Docker environment rather than using VMs, but I don’t understand how for instance I’d allow for moving a container from one Docker server to another and automatically having pfSense route requests to the new location - it sounds as if you can expose ports from the container on the Docker server that hosts it, but the visible IP address is still that of the Docker server and would change if a container was moved from one Docker server to another.

I’m just looking here for a pointer as to what concept I’m missing that I need to go research to figure out how to deal with this.


(Nathan Le Claire) #2

It sounds like you might be looking for overlay networking driver, which allows containers to communicate seamlessly across hosts.


(Darkstar) #3

You might want to take a look at lxd which supports checkpoints and live-migration. It’s not really in scope for docker, which deals with apps that simply “scale out” by adding new containers and retiring the old ones, and handles failing nodes by simply restarting the containers on a different host. lxd is more similar to “classic” VMs