What is Container?
A collection of software processes unified by one name space, which access to an operating system kernel that it shares with other containers and little to no access between conatiners.
Docker
Before going to docker, we should understand virtualization.
Virtualization that allowed us to run multiple operating systems on the same host. This was a game-changer, but also seemed to be very expensive with multiple kernels and OSs.
Docker is a software containerization platform that allows DevOps to build, ship, and run distributed processes within containers.Containers are isolated but share the same OS kernel. This way you get to use hardware resources more efficiently compared to virtual machines.
Each container can hold a single process, like a web server or database management system. You can create a cluster of containers distributed across different nodes to have your application up and running in both load balancing and high availability modes.
A runtime instance of Docker image contains three things -
- A Docker image
- An execution environment
- A standard set of instructions
Docker Image (package of the software and everything it needs in order to run) is class and container (An instance of an image) is an Object
Docker Eco System
Docker Engine
- Comprised of runtime and packaging tools
- Must be installed on the hosts that run Docker
Docker Store
- An online cloud service where users can store and share their Dokcer images
- Also known as Docker hub.
Why Has Docker Become so Popular?
-
Lightweight
-
Portable
-
Fast
-
No hypervisor
Docker is a form of virtualization, but unlike the virtual machines, the resources are shared directly with the host.
A virtual machine has to quarantine off a set amount of resources like HDD space, memory, processing power, emulate hardware, and boot the entire operating system. Then the VM communicates with the host computer via a translator application running on the host operating system called a "Hypervisor."
On the other hand, Docker communicates natively with the system kernel, bypassing the middleman on Linux machines, and even Windows 10, Windows Server 2016, and above.
This means you can run any version of Linux in a container and it will run natively. Not only this, Docker uses less disk space, too.