Docker: A Brief Introduction


Docker: A Brief Introduction (PART 1)

Docker is a comprehensive solution to parallelism with the aim of easing deployment of multiple applications with along with their requirements through a single platform.

Now, that is a heavy definition to begin with but sums up what docker really is and used for! In simple words, docker is an engine used to run containers. Containers, in real life, are used to store goods and commodities. The special feature of any container is that their contents remain in themselves and are not visible outside. This sounds too obvious but is utilised in implementing abstraction in software deployment. The takeaway from any discussion on containers is:

CONTAINERS IS A SET OF SPECIAL PROCESSES WHICH REMAIN ISOLATED FROM REST OF THE SYSTEM

So, What goes in, stays in and runs within that !!

alt text

So, why do we need containers in the first place?

Development and Deployment is an interconnected chain of Software Engineering.

The DEV Team focuses on the following:

  1. FREQUENT DEPLOYMENT OF DEBUGGED CODE
  2. EASE OF ADDING NEW ADD-ONS OR UPDATES

The OPS Team focuses on the following:

  1. STABILITY OF THE DEPLOYED APPLICATION
  2. MONITORING AND CONTROL
  3. EASE OF PRODUCTION AND MANAGEMENT OF NEW RELEASES

DevOps is the intersection of both these teams and tries to follow an integrated approach to the whole system. Containers make deployment easy. We just have to run our entire application in a single container that can exist independently along with other applications without being affected by other’s requirements.
alt text

A typical web application looks like the following:
alt-text
Now, as you can see, we have different engines, versions of applications running together as a single block. Imagine, if I have one more application having similar architecture:
alt-text
So, these can run parallel using the same environment! But, what if a new app comes up that needs Wordpress 5.0 and PHP 5.7?? Thus, we solve this issue of dependency conflict using Docker:
alt-text
Now my problem of different versions requirements to run an application is solved. Plus, I can scale the application as per my wish which is another bonus as it does not affect other applications and their dependencies at all !! Thus, the main advantages of these containers are:

  1. Easy Deployment
  2. Seamless Updates and Upgrades with new releases
  3. Better Scaling up All these are provided by Dockers and their products ! Let’s explore them now ! Let us begin by installing Docker:
    $ sudo apt-get install docker
    

    Next, we need to check whether our installation was successfull.

$ sudo docker run hello-world

You can skip the sudo if you are running docker as adminstrator. You should get the following message if the installation was successfull:

Hello from Docker!
This message shows that your installation appears to be working correctly.

Next, we will learn more on using docker with hands-on in the next post!