Hello, readers! In this article, we will be focusing on the concept of Docker Containers, in detail. So, let us begin! 🙂
Table of Contents
What are Virtual Machines [VM]?
Bare metal servers are inefficient. They require a lot of physical space, lots of cooling equipment, and impact the environment in a negative way. There had to be a better way out. The developers got thinking. Why not simply turn a single, powerful computer into a multi-dimensional server that runs multiple isolated applications simultaneously?
And this idea gave rise to the development of Virtual Machines.
Virtual Machines are computer files that are computer software that is an image and it acts like computer hardware. That is, it creates a computer within a computer. It virtualizes the environment for us. Above the VM, we have a hypervisor, also known as virtual machine monitor. This is software that creates, provisions, and runs Virtual machines over the actual physical hardware. It resides between the VM and the physical server and plays a key role in the virtualization of the server.
Over the hypervisor i.e. within the Virtual Machine resides unique guest operating systems. Virtual machines can have various operating systems running on the same server (hardware). This level of virtualization provided benefits in terms of memory and wide level usage of the servers. The hypervisor allows multiple VMs to run on a single hardware.
But Virtual Machines have limitations
As every Virtual Machine has its own operating system image that runs over the VM through the hypervisor, the binary and library files needed ended up occupying GBs of space. It added the overhead of extra memory and lead to storage issues.
Thus, Docker and Docker Containers were born to help us overcome the limitations of Virtual Machines.
What is Docker?
Docker is a containerization platform that offers Platform-as-a-Service to the users. It packs the application and all the dependencies into a Container and then runs the application seamlessly over it in any framed environment.
Docker offers us with the below strong inputs to customize the virtualization of an application:
Let us have a look at them now!
Docker Containers and Images
Containers in Docker are units of software that pack the application with all its dependencies such as binary files, libraries, etc., and then run the application on any given environment easily.
Unlike VMs, a Container virtualizes operating systems so that multiple software and applications can have shared instances of operating systems. The containers run over a a host Operating system and thus provide application level packing for the software.
Docker Image is a standard-template that has instructions to create and run containers on the hosted OS.
Now, let us consider an example to understand the concept of Docker Containers and Images.
Consider a software development team. At first, the developer builds an application and installs apache server for the same, Post which, the testing team again installs the apache software to test the application. So you see, the apache server is being installed twice.
This can be solved using Docker Images.
We create an Image which provides instructions to install apache server and all necessary dependencies. Further, the developer and tester can build the docker Image and run the instance of application as a Container over the same shared host operating system.
Recommended read: Deploying Node.js application on Docker
By this, we have come to the end of this topic. Feel free to comment below, if you have questions. For more such posts related to Docker and other technologies, Stay tuned with us.
Till then, Happy Learning.