- March 15, 2018
- Posted by: Mahesh Kulkarni
- Category: Blogs
What is a Container? Or rather What Are Containers?
Containers or Container Images are a lightweight, stand-alone, executable packages. These packages would natively include Code, Run-Time, System Tools, System Libraries, Settings…etc besides other optional paraphernalia that may be required for a successful execution of the software application.
Containers are available for both Windows and Linux based apps. Containerized software will always run the same, regardless of the environment in which they are hosted/executed. Simply put, containers isolate the software from its surroundings.
Some more features of Containers?
- Light Weight: Docker Containers run on a single machine, and share its Operating System Kernel. They start instantly and use less compute and memory, hence making them light weight and fast and easy to spin off and deploy. The Images are built out of file-system layers and share common files, thus minimizing disk usage. Docker image downloads are much faster due to their smaller size.
- Platform Independence: Docker Containers are not restricted to any particular OS platform, and are available for Windows, and all major Linux distributions.
- Infrastructure Independence: Docker Containers can also be very easily deployed on any infrastructure including VM’s, Bare-Metal and in the Cloud.
- App Isolation: Docker Containers isolate applications from one another and from the underlying infrastructure, thus providing the strongest default isolation to limit app issues to a single container/node instead of the entire machine. So if there is an error in a code on a particular node/container, the lead etc only will need to restart that node or container, and NOT the entire infrastructure, thus minimizing down-time for the entire team. Yes, it would be fair to say that the impacted app and its linked apps (which depend on it or it depends on them) may cease to work as per expectations during this downtime.
To understand this better, let us see a small example, in which we have an IT Infra Management Software, whose artifacts are distributed across 2 nodes: Node1 and Node2. Node1 contains App-A, App-B, and App-C, while Node2 contains App-X, App-Y & App-Z. Now the QA has reported a bug in App-C, which has been fixed by the Dev team, and the fix will require a restart. So when the lead restarts App-C, only those artifacts/apps that are dependent on App-C or on which App-C depends will be impacted, and not the entire software.
Needless to say, that in certain unavoidable situations like Security Patching, DB Patching etc, a restart of both the nodes will be required, thereby making the entire software unavailable for all teams, probably even production customers in certain rare cases. But then again this is NOT a disadvantage of a Docker, merely a requirement that has to be followed for due safety and compliance and may have unwanted repercussions if not adhered to.
Containers v/s Virtual Machines:
Containers and Virtual Machines have similar resource isolation and allocation benefits but function differently. This is because Containers virtualize the OS instead of the hardware, and are hence more portable and efficient and easy to deploy.
Containers are an abstraction at the Application Layer which packages code and dependencies together.
Multiple Containers – One Host: Multiple containers can run on the same host, and share the OS Kernel with other containers that run within that host. The User Layer is where each individual container runs as an isolated process.
Lesser Footprint: Containers take up far less space as compared to VM’s, and start almost instantly.
Virtual Machines or VM’s as they are also called are an abstraction of the physical hardware, turning one server into multiple servers. This abstraction is achieved by a software called as a Hypervisor. A Hypervisor is basically a software application, which allows multiple VM’s to run on a single host. Each VM includes a full copy of an OS, one or more apps, necessary binaries, drivers and libraries etc, and can take up quite a huge amount of space (generally the same amount as the OS and Apps would take on a physical machine). VM’s may at times also be slow to boot.
HyperV, VMWare, Oracle VirtualBox etc are examples of Hypervisors.
So can Containers and Virtual Machines Co-Exist? Well yes, Containers and VM’s can be used together, to provide a great deal of flexibility in deploying and managing apps. We can install Docker Containers within VM’s to showcase as a POC as well.
Parting Shot: Stay tuned for: The reality surrounding Dockers!! Let’s meet on the other side!! Till Then…Adios!!!