Docker Community Forums

Share and learn in the Docker community.

Newbie - swarm requires VMs

(Trecime) #1

I’m new to containers and have read articles discussing advantages of docker containers vs VMs. Saw the nice picture diagrams, showing that VMs require so much more resources, including the hypervisor and guest OS. So in a docker Get Started tutorial , Step 4: “Swarms”, I’m now confused to see that Swarms say you need to get a hypervisor and create some VMs to run the docker containers. I apologize if this is the wrong place to get such general info, but could someone please point out to me why Docker containers are superior to VMs, if it turns out you actually need hypervisors and VMs after all to do container management and deployments? (Or please point me to a better resource?) Thank you!

(David Maze) #2

Swarm is, at its core, a multi-host container scheduling system, so you need multiple VMs to have multiple systems to schedule containers across.

You don’t need to use Swarm to use Docker (and I wish didn’t have it so prominently). If you have a Linux host already, you can directly use docker run and Docker Compose and the like without needing to use an intermediate VM, and get the efficiency benefits you cite.

(Trecime) #3

OK, thanks David! I think I’m understanding that that tutorial was just trying to get you those additional server/hosts created for you and not saying that docker does require a hypervisor if you want to use Swarm. Swarm does sound like a good way to manage your containers, so sounds useful. If we ever did decide to move our legacy enterprise app into containers, we’d probably need some sort of management module. Thanks for your help!