xxxxxxxxxx
Difference between docker and virtual machines
xxxxxxxxxx
No. Virtual Machines(VM) Containers
1 VM is piece of software that allows you to install other software inside of it so you basically control it virtually as opposed to installing the software directly on the computer. While a container is a software that allows different functionalities of an application independently.
2. Applications running on VM system can run different OS. While applications running in a container environment share a single OS.
3. VM virtualizes the computer system. While containers virtualize the operating system only.
4. VM size is very large. While the size of container is very light; i.e. a few megabytes.
5. VM takes minutes to run, due to large size. While containers take a few seconds to run.
6. VM uses a lot of system memory. While containers require very less memory.
7. VM is more secure. While containers are less secure.
8. VM’s are useful when we require all of OS resources to run various applications. While containers are useful when we are required to maximise the running applications using minimal servers.
9. Examples of VM are: KVM, Xen, VMware. While examples of containers are:RancherOS, PhotonOS, Containers by Docker.
A virtual machine uses a hypervisor to run a complete copy of an
operating system, while containers are processes in a Linux host.
xxxxxxxxxx
VMs have the host OS and guest OS inside each VM.
A guest OS can be any OS, like Linux or Windows, irrespective of the host OS.
In contrast, Docker containers host on a single physical server with a host OS, which shares among them.
Sharing the host OS between containers makes them light and increases the boot time