Containers Are Not VMs.
VM (House)
- Full OS to Start with and strip away what's needed.
- Virtualization technology.
- Everything that sits on a physical Server and pack it in to a single portable binary.
Container (Apartment)
- Start with basic and add what's needed.
- Application delivery technology.
- The abstraction is the application, more specifically a service that helps to make up the application.
Containerization Basics.
Containers are isolated in a host using the two Linux kernel features called namespaces and control groups.Namespaces
- There are six namespaces in Linux (mnt, IPC, net, usr etc.).
- Using these namespaces a container can have its own network interfaces, IP address etc.
- Each container will have its own namespace.
- The processes running inside that namespace will not have any privileges outside its namespace.
Control Groups
- The resources used by a container is managed by Linux control groups.
- CPU and memory resource is assigned to a container using Linux control groups.
Virtual Machine Basics.
A VM is essentially an emulation of a real computer that executes programs like a real computer.VMs run on top of a physical machine using a “hypervisor”. A hypervisor, in turn, runs on either a host machine or on “bare-metal”.
VM On Hypervisor
- If one VM is running a more resource heavy application, allocate more resources to that one than the other VMs running on the same host machine.(represented as fat in diagram)
- The VM that is running on the host machine (again, using a hypervisor) is also often called a “guest machine.”
- This guest machine contains both the application and whatever it needs to run that application (e.g. system binaries and libraries).
- It also carries an entire virtualized hardware stack of its own, including virtualized network adapters, storage, and CPU — which means it also has its own full-fledged guest operating system.
- From the inside, the guest machine behaves as its own unit with its own dedicated resources.
- From the outside, we know that it’s a VM — sharing resources provided by the host machine.
Hypervisor
- Well, since the VM has a virtual operating system of its own, the hypervisor plays an essential role in providing the VMs with a platform to manage and execute this guest operating system.
- It allows for host computers to share their resources amongst the virtual machines that are running as guests on top of them.
- More variations to it, if using bare metal hypervisor--> here.
- https://blog.docker.com/2016/03/containers-are-not-vms/
- https://blog.mikesir87.io/2017/05/docker-is-not-a-hypervisor/
- https://devopscube.com/what-is-docker/
- https://medium.freecodecamp.org/a-beginner-friendly-introduction-to-containers-vms-and-docker-79a9e3e119b
- https://blog.docker.com/2016/03/containers-are-not-vms/
- https://stackoverflow.com/questions/48251703/if-docker-runs-natively-on-windows-then-why-does-it-need-hyper-v
Comments
Post a Comment