Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the point of using Docker on top of a virtual machine?

New to Docker...Docker is described as an alternative to virtual machines. I've read a bit now and that makes sense. What I don't fully understand is why you would use Docker on top of a virtual machine eg. this is exactly what AWS now offer with beanstalk.

Is it simply because most hosting is VM based, and Docker gives you flexibility so even though it's not replacing the VM, it's still (potentially, depending on use-case) worth using?

like image 503
nashape Avatar asked Jun 09 '14 16:06

nashape


People also ask

Why are containers over VMs?

Containers are more lightweight than VMs, as their images are measured in megabytes rather than gigabytes. Containers require fewer IT resources to deploy, run, and manage. Containers spin up in milliseconds. Since their order of magnitude is smaller.

Do containers run on top of VMs?

Running containers: bare metal or VM? Containers are a form of virtualisation, but one in which the application and all the microservices needed for its execution run on top of the host server operating system, with only the container runtime engine between the two.

Can Docker work on virtual machine?

Yes, You Can Run Docker AND Virtualbox on Windows 10 Home.


2 Answers

The use case which works for us is that you can use the same docker image on top of a real box, virtual machine, different operating systems, etc. and have the same controlled environment.

Even if you only plan to run this on one type of machines (e.g. on EC2 virtual machines), you still probably develop it on your laptops or desktops, so it may make sense to use it.

And the good part is, that the Docker overhead is very small (or at least that's the idea), so it wouldn't impact the performance even when run on virtual hardware. This is in contrast with "real" virtual machines (no pun intended, but it sounds good :)), which would bring a large overhead in similar scenario.

like image 194
ivant Avatar answered Sep 19 '22 19:09

ivant


Everything at Google runs in a Linux container, according to Infrastructure VP Eric Brewer.

But everything at Google doesn't run in a VM.

Yes, KVM is used when a different OS is needed, and the public Compute Platform service (for now) runs Docker inside VMs, perhaps for stronger isolation and control. Otherwise, most of Google's containers run on bare metal. Why add extra overhead?

If you know differently, please correct me.

In the enterprise today, the ratio of VMs to containers may be 99 to 1. How long until it's 30/70 or 20/80?

While Kubernetes and other container orchestration tools may never reach vSphere's polish and ease of use, I wouldn't want to be a virtualization vendor right now.

like image 43
Paul Avatar answered Sep 17 '22 19:09

Paul