So, what is a Container?
Container is analogical to a process in an operating system, simply imagine a process running in an operating system.
Below is a snap grab from my laptop which shows certain PowerPoint and Word processes which are running on top of the operating system, containers work in a very similar fashion as minuscule processes on top of the operating system
Containers run in the same way as a normal process in an OS.
So, a Container is nothing but an application which is running like a process on top of the Operating system and using the following resources, similar to what a normal process would use in an Operating system.
ü OS Kernel
ü RAM
ü Network
ü CPU
ü Installed libraries, executables, and files on disk
In the below diagram shown you can clearly see how 2 containers are running in an isolated manner using only specific resources allocated for them
2 Containers running in an isolated manner on a virtual machine
All the above resources are facilitated to the container by our very own friend called "Docker", I am sure you must have heard this term by now but if you haven't, no need to worry, you would learn it in the next 2 minutes.
So, we started from Microservices and to build them we need containers which are nothing but similar to a process which is running independently utilizing some parts of the CPU, RAM, Disk. Going back to virtualization we know that VMs are also partitions which utilize only the resources which are allocated to them but what is the technology which makes it possible to create VMs and make them share the underlying hardware with certain limits, to be precise that technology is called as a "hypervisor" such as ESXi, HyperV, Xenserver which actually enables the virtualization technology, similarly, to enable containerization where you can build independent containers with their independent resource partitions, you need something called as “Docker”, do not be confused and overwhelmed by Docker, it’s just another software which you install on your Operating system which acts similar to a "Type-2 Hypervisor" for creating, deploying and running containers on top of an Operating system.
The "Type-2 Hypervisor" term which I am using here is just for you to correlate and imagine what a Docker is otherwise the Industry does not call it as a Hypervisor, it's just my way of explaining things
We understood what a Container and Dockers is, but in the real world we would be dealing with another term for Containers called PODs.
POD" is a term which is interchangeably used with "container" when we are using Kubernetes; so, for now just remember that a POD is a primary process under which a subprocess is running which is called container so you can imagine the POD as a wrapper on top of the container, so in the Kubernetes world we would be dealing with the term Pod more instead of container.
A Pod can have a single container hosted inside it or can have multiple containers hosted in a single POD but the ideal Industry design is to have 1 container in 1 POD
I have introduced one more Jargon in the above space called as Kubernetes which I would explain in the next section.