Docker - Episode 1

What is Docker 

So, Docker is buzzword these days. Let's try to understand , is it just a hype or really Docker is a super Assistant.

Docker makes development, shipping , installing, deployment easy.

A Docker is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.

Docker is a tool designed to make it easier to create, deploy, and run applications by using containers.

Docker Image & Container

A Docker image is a file, comprised of multiple layers, used to execute code in a Docker container.

A Docker Container is nothing but running instance of Docker Image. 
So you can think of Docker image as .class in Java World and when it executes as an application, that is your Container.

Docker as a Code & its Analogy with Git

Don't get me wrong here. We are not comparing Docker and Git here nor we are saying both tools are serving same purpose or so . 
The point I am making here , think of Docker images as code. Once you think that way , you know that you will have a Repository for Docker from where you will do checkin and checkout . Similar to GitHub , you will have DockerHub . And all this is true.  So , think of everything as a code now . Whether it is setting up Operating System , Installing JDK or installing your app and running it . All this is a code and you will write all this code inside Docker Image as a set of Instructions , that's it. 

Write Once , checkin and you are done. Just pull the Docker Image on any server to setup and run your application within seconds . 

Can you now see how Docker helps in Development too? 
Do you remember the old days when a new Engineer in your project used to spent at-least 2-3 days for setting project environment up and running and finally getting a huge smile once he/she sees home page of Project. Now with Docker around, those 3 days are now reduced to a minute ,amazing!

Why Docker

Resource Efficiency

It makes best use of resources , that's why it is a Buzz word though concept of Container is not new. 
Let's say , you have 10 Docker Containers, you can run all of them on single virtual machine. While without Docker, you will need 30 Operating Systems at-least if not 30 physical machines.

Cost Savings

As explained above, it saves a lot with respect physical resources.

Dev/Prod Parity 

This is one of 12-factor app principle and with write once and run/deploy anywhere, Docker helps getting consistent environment.

Standardisation & CI/CD implementation
Docker gives you repeatable development, build, test, and production environments. Docker goes beyond consistent environment feature to get CI/CD implemented.

Industry use

Last but not the least, because of above reasons since it is preferred by industry , it's good to be in the same boat as others.

Advantages of Docker

Though we have seen this in Why Section above, let's put it on the table :

  • Environment Standardisation
  • Dev/Prod Parity
  • Version Control of Environment/Maintanability
  • Isolation between Application & Resources
  • Security
  • Multi-Cloud Platforms Support
  • Cost Effective ( Return on Investments) 
  • Simplicity
  • Rapid Deployment

Disadvantages of Docker

Let's look at other side of the coin.
  • Too much communication between Containers
  • Some Containers do not talk to each other - Compatibility issues
  • Complicated Data Storage ( Data Volumes help but still there is lot of complexity)
  • Not a Solution for all - Do not gel well with Graphical Applications, Legacy Monolith etc.
  • Some Missing features like Copy files from host to Container ( Getting improved with every version though).

World before Birth of Docker

Though the concept has been around for a while, before Docker , Virtual Machines were the ones liked by Infrastructure Teams.

Docker versus Virtual Machines
Virtual machines have their own operating systems, its own memory management. Run on top of Hypervisor. Heavier than Docker.
Virtual machines do well in one aspect , isolation. 

Alternatives to Docker

  • Apache Mesos
  • NanoBox
  • OpenVZ
  • rkt

Summary & What Next

In this blog, we have seen what is a Docker, why use it , its pros and cons, alternatives , comparison with VM etc. In next blog , we will see how to install Docker and start using it, stay tuned.

No comments:

Post a Comment