# Both Docker and Virtual Machine address Virtualization.
A process where software is used to create an abstraction layer.
What is Docker:
- An open source platform that uses containerization technologies
- It allows developers to package applications and their dependenciesĀ
- Lightweight portable containers
- These containers virtualize the operating system
The main components of Docker:
- Docker Engine:
- The core software that manages the life-cycle of docker containers
- Responsible for Creating, Running and Orchestrating the containers
- Interact with host kernel to allocate resources for the containers
- Enforce isolation between containers
- Cgroups
- Namespaces
- Docker Images:
- Light weight, stand alone and executable packages
- That includes everything it need to run a software
- Build using Docker files
- Docker Containers:
- These are instances that run in the docker engine
- Isolated and self sufficient environment that include only the necessary components to run the specific application
Use case of Docker containers:
- Microservice
- Rapid Development and Deployment
- Resource efficiency
Virtual Machine
Hypervisor:
- A software that emulates a physical machine
- It manages the allocation of h/w resources with different virtual machines
- Each VM run its own OS and has its own virtual hardware
Two types of hypervisor:
- Type 1 (Bare Metal Hypervisor)
- Runs directly on the host hardware
- Type 2 (Hosted Hypervisor)
- Runs on top of an Operating System
Virtual hardware:
- Virtual CPU
- Virtual Hard disk
- Virtual memory
Guest OS:
- Individual OS that runs on the virtual machine
- Run multiple operating system on the same physical host machine
Use cases of VM:
- Diverse Operating System
- Run windows or Linux on the same host machine
- Isolation of OS
- Runs its own separate kernel and OSĀ
- Suitable to run Legacy OS
- Can run and test legacy OS that might not be compatible with host OS