About Us
IDKBlogs

  All  
Javascript
NodeJS
AngularJS
Angular2+
ReactJS
Others

A best cloud deployment technique: Docker

  idkblogs.com      July 7, 2019

Shubham Verma

Shubham Verma


A best cloud deployment technique: Docker

S

uppose, You created an application, and its running very well on your machine, But you need to deploy this into other machines… What will come into your mind?

Of course, You need to install all the dependencies, software and tools into other machines for this app.
Let’s suppose again.. What if you have created two applications and want to deploy on another machine ( Both app in the same machine ). What will you do?

Here Docker will help you…..
"Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Docker is the best deployment technique this time and it is very effective while deployment. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package. By doing so, thanks to the container, the developer can rest assured that the application will run on any other Linux machine regardless of any customized settings that machine might have that could differ from the machine used for writing and testing the code."
— opensource.com

# Let’s pick a real technical example:

Imagine we have a computer, suppose there are 3 applications App1, App2, and App3 and computer have only one set of libraries & Framework like this:

Docker .. A best cloud deployment technique

Source: idkblogs.com

Imagine our all 3 applications needs Ruby on Rails frameworks and our system has installed this. Now our all 3 applications working fine. But what happen if our all 3 applications need different version of Ruby on Rails.
Suppose :
App1 need Ruby On Rails version 1
App2 need Ruby On Rails version 2
App3 need Ruby On Rails version 3

As in picture:

Docker .. A best cloud deployment technique

Source: idkblogs.com

And our system has installed Ruby on Rails version 3.

Docker .. A best cloud deployment technique

Source: idkblogs.com

Then can you guess what would happen? Our App1 and App2 would stop working and only App3 will work.

Docker .. A best cloud deployment technique

Source: idkblogs.com

How do we fix this ? How do we get all three application would work?

We have two solutions..


Solution 1:

Different computer for a different app with the appropriate version. Docker .. A best cloud deployment technique

Source: idkblogs.com


It means :

App1 would have Ruby On Rails version 1.
App2 would have Ruby On Rails version 2.
App3 would have Ruby On Rails version 3.

Docker .. A best cloud deployment technique

Source: idkblogs.com

Now our all app will work properly.

Docker .. A best cloud deployment technique

Source: idkblogs.com

But that would be very expensive, That is what virtual machines ( VMs ) do.

The virtual machine replicates over and over and over again.

Is there a better way?......... Yes there is: Docker

Docker .. A best cloud deployment technique

Source: idkblogs.com

To get rid of this problem you can use “Docker”. You can wrap your application within the docker. And every app will run under a container. For your understanding, A container is a software environment that contains one or more process.

Docker .. A best cloud deployment technique

Source: idkblogs.com

In the above image, every app is running under the separate containers, and every version of Ruby on rails is running on a different image, all are running under the same OS.

Docker .. A best cloud deployment technique

Source: idkblogs.com

Using docker, If you want to run App1 into other systems, Just copy App1 and paste it to the location. and run using the docker. The app will work fine in another system.

Basic terms of Docker:

Image:

An image is a portable program of a set of files that can be reused and served. They are divided into layered and layers can be reused. It is used to execute code in a docker container. An image contains a set of instructions to execute an application. When docker starts, images get executed and become one or multiple containers.

Container:

A container is a run time environment on the image. Container holds the application and is responsible to run an application. Now you have a basic idea about the docker. I will soon write an article on “How to dockerize an app”.

Conclusion:

In this article, we learned "what is docker? and its image and container."


Thank you

for taking the time to read this article. If you’re interested in Node.js or JavaScript this link will help you a lot.



OTHER POSTS

Copyright © 2020 IDKBlogs | All Right Reserved

About Us

Powered by : IDKBlogs

Last Update : 19/09/2020