DOCKER – A DIFFERENT SPECIES OF VIRTUALIZATION

In early days, we used to have virtual machines (VMs). This virtual machine help us in managing different operating system in the same hardware. It means On same hardware, we can have Windows server and Linux server and so on. We also need to have hyper-v to run this VMs.

Why Virtual machines?

  • Cost: Hardware are costly to buy for each service / component.
  • Wastage of H/W resources: For a single application, if we keep whole machine for a single application, then it will be wastage of resource if we compute power of server is not fully utilized.
  •  Maintenance / Upgradation / Configuration of hardware.

So due to these reasons, We have VMs. On same hardware machine, we can have multiple operating system using Hyper-V. Each OS shares same hardware. Like main memory, host OS etc.

vm

But here the problem is we need to still maintain multiple operating system with its configuration, licensing, security etc.

Solution of all these problem is Docker & Container.

What is Container & Docker?

Container packages application, libraries and all its dependencies and deploy it to server. Docker is a tool which help us in making these containers. Now, the obvious question is what kind of application we can store in container? Any application whether its Windows or Linux or Mac based. Container shares the same operating system and hardware.

Structure of Container

Container contains combination of multiple images. There is stack of image layers. Base layer is framework related or OS related. Then on top of that, we can have application image layer. Top layer is the only layer which allows us to read / write and all other layers are readonly. Base layer we need to refer from docker hub. More than million base images have been already created.

So lets take an example. If I have .net web API, then definitely, To run this API,  we need core SDK runtime image and asp.net core environment image and image of this API itself. So my final image will have API image, ASP.Net core image and Core SDK runtime image. (Top to bottom in stack).

We will package this final image and build it. After building of it, we can run it from any server (Windows / Linux / Mac).

N-tier architecture example: Front-end can run from one container. Database can run from another container. We can have multiple containers for application layer.

docker

Benefits of having Containers

  • Scale up / down quickly: We just need image of application. We can deploy / run multiple instance of this image from multiple container.
  • Share same OS: No need to worry about OS. All dependencies of OS are already built in the image. No need to maintain multiple OS.
  • Open source technology.
  • Best for Microservice architecture.
  • Portable

Happy containerization!

One thought to “DOCKER – A DIFFERENT SPECIES OF VIRTUALIZATION”

Leave a Reply

Your email address will not be published. Required fields are marked *