I believe there are no develper now a days who do not hear the word Container and the company which popularize the technology Docker Inc.. But what the heck is this? According to Wikipedia, Container is
Linux containers is a generic term for an implementation of operating system-level virtualization for the Linux operating system.
What... 🤔!!!??. I agree, it is really a very hard definition for a beginner.
Let's see how Docker itself define Container. According to Docker, Container is
A container image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings.
But I think Google (Fact: Did you know that Google is using container technology for more than 12 years?)😎 gives the more accurate definition of Container. According to Google, Container is
Containers offers a logical packaging mechanism in which applications can be abstracted from the environment in which they actually run.
If you still puzzled, please allow me to give a definition for container according to my understanding,
Container is a kind of baby computer in a computer that gives you an isolated environment with its own filesystem, networks and other necessary permissions where you can play with your application without affecting (not counting some special cases) your host environment and package the exact same state of the baby computer to move it to another computer in a platform agnostic way
Container is not a Virtual Machine
Let me show you the famous image when people wants to differentiate these two things
As you see, instead of virtualizing the hardware stack as with the virtual machines approach, containers virtualize at the operating system level, with multiple containers running on the top of the OS kernel directly. This means that containers are far more lightweight: they share the OS kernel, start much faster, and use a fraction of the memory compared to booting an entire OS.
Note: For more you can download Docker E-book on this topic from here
Why Container is so important
It opens a new horizon of packaging and delivering the application and completely revolutionized the idea of deploying application to server.
Lightweight and Faster: It takes miliseconds to up and running a container with a very small memory footprint.
Secure: As your container provide a sandboxed environment so it can't access anything outside its own boundaries. You can configure permission, disk space, memory usage, libs and bins to load of your container.
Platform agnostic: While deploying your app with container you can just feel free about your host machine OS where you are deploying your containers. Now you can run contaianer every major platform Windows, Linux even macOS can run containers.
Immutable behaviour and stability: Release new versions changing the containers and guaranteeing the right environment. Containerized software will always run the same no matter on which platform you are running the containers. No more Works on my compter excuse!! Yes, sad news for a special group of people !! 😉
Scalibility: Scale your service/application replicating containers as long as your traffic is heavy and turn some down when it is not so bothered.
Delivering Software with confidence: Delivering application/software using container gives you more confident to work as expected by embracing Continious Integration. It makes embracing CI piece of cake by choosing right tools according to your needs.
I am a forever learner. I will be grateful to you if you share your comments and thoughts on the post and help me correct my mistakes
Next: A beginner friendly introduction to Docker Coming soon