Before starting with docker, a small introduction about container is must. But again before containers we need to understand why not to use traditional technologies, what are the drawbacks of using virtual machines. Why are we moving to container world.
See, we need to understand the why behind the containers. Till now, everyone understands that Applications run Businesses. And in past we used to run single application on single server which lead to big expenses having included installation fee, cooling devices and administarter fee etc. Even after getting everything done, we still lacked processing and scalability. Companies tried to buy overpowered servers beacuse they had no exact idea of how much powerfull server they need and it resulted in loss of money and resources because most of the time, only 10% to 20% processing power was used. Then one day we heard VMware Technology
After VMware, it seemed like everything changed overnight because now our overpowerd servers could be used upto their capability. Instead of using one physical server to single app, now we can run multiple apps over single server. But if you think, it is also not a perfect solution.
Because in this, if you look at point one then, my system resources are consumed by the VMware only. My guest OS will consume my system resources(CPU, MEMORY, DISK) and I have not yet talked about application running over these virtaul OS. Also we need licenses for each OS which will again cost me a lot. But this is not all, we also need to safely and securely run our apps directly on the server. Each VM needs feeding and caring. Patching security issues, updation and even other firewalls and anitviruses. Virtualization has made our lives easy but still IT needs to work hard to cover its shortcommings. And hence we move to containers.
Lets finally dig into containers. Now in containers we have one system and one OS, and we create four containers over the OS. Each container is just a slice of the operating system. Each container is dedicated to one application. I have created four containers but it is not limited to four.
If you see, in above image we only have installed one single operating system over our hardware. Then we further peel off or say take a slice of the operating system and make it a container. These containers are not like virtual machines which eat our hardware resources. They are very small and are very fast. In container, our OS is already running and we just need to run our contained application. Unlike Virtual machines we need to first boot our OS before running our application. Applications inside a container spin up in seconds.