๐ ๐๐ก๐๐ญ ๐ข๐ฌ ๐ ๐๐ข๐ซ๐ญ๐ฎ๐๐ฅ ๐๐๐๐ก๐ข๐ง๐?
A Virtual Machine (VM) is a software-based emulation of a physical computer, allowing multiple operating systems to run on a single physical host. Each VM operates as an independent and isolated instance with its own virtualized hardware components.
Virtual Machine is a system which acts exactly like a computer. VMs are like physical hardware turning one server into many servers. It uses technology called hypervisor which allows multiple VMs to run on a single machine. Each VM has a full copy of an operating system, the application, necessary binaries and libraries. VMs are bulky in nature.
๐ ๐๐ก๐๐ญ ๐๐ซ๐ ๐๐จ๐ง๐ญ๐๐ข๐ง๐๐ซ๐ฌ?
Containers are packages of software that contain all of the necessary elements to run in any environment. In this way, containers virtualize the operating system and run anywhere, from a private data center to the public cloud or even on a developerโs personal laptop. Containerization allows our development teams to move fast, deploy software efficiently, and operate at an unprecedented scale.
Containers are lightweight, portable, and self-contained executable images that contain software applications and their dependencies. They are used to deploy and run applications in a consistent way across different environments, such as development, staging, and production. Containers are typically deployed from an image by using an orchestration platform, like Kubernetes. These platforms provide a way to manage and deploy containers at scale.
๐ ๐๐ข๐๐๐๐ซ๐๐ง๐๐๐ฌ ๐๐๐ญ๐ฐ๐๐๐ง ๐๐จ๐ง๐ญ๐๐ข๐ง๐๐ซ๐ฌ ๐๐ง๐ ๐๐๐ฌ.
โข ๐๐ ๐๐ง๐ ๐๐ซ๐๐ก๐ข๐ญ๐๐๐ญ๐ฎ๐ซ๐: Virtual machines have a host OS and the guest OS inside each VM. Guest OS can be any OS, like Linux or Windows, irrespective of host OS. While Docker containers host on a single physical server with a host OS, which shares among them. As it shares the host OS between containers it makes them light and increases the boot time.
โข ๐๐จ๐ซ๐ญ๐๐๐ข๐ฅ๐ข๐ญ๐ฒ: Virtual machines are isolated from their OS, and so, they cannot be ported across multiple platforms. Docker containers can be easily ported across different platforms as they are self-contained and can run applications in any environment, and since they donโt need a guest OS.
โข ๐๐๐ซ๐๐จ๐ซ๐ฆ๐๐ง๐๐: Virtual machines are more bulkier than Docker containers as the virtual machines need to load the entire OS to start. The lightweight architecture of Docker containers are light weight as they donโt have a guest OS.
โข ๐๐ข๐ซ๐ญ๐ฎ๐๐ฅ๐ข๐ณ๐๐ญ๐ข๐จ๐ง: Virtual Machine use Hardware level virtualization and Containers use OS level virtualization.