Introduction to Docker


What is Docker ?

Docker is a platform for dev shipping ,running app using container virtualization.
 Virtualization
  1. Hypervisor based virtualization.



  • Bottom layer we have the physical server we installed operating system on top of that.

  • A Hypervisor is introduced on top of the operating system which allows us to install multiple virtual machines on a single machine.

  • Each of these virtual machines can have different operating systems installed and each can run.

  • Example for hypervisors are VMware virtual box
Pros
  • Efficient in cost each physical machines can run multiple vm's

  • Easy to scale and deploy.
cons
  • Each virtual machine still needs to install an operating system which is a whole another OS with it's own memory,drivers etc,. The point is we need a whole operating system to run our application.

2) Container based Virtualization.


  • Docker is a one implementation of container based virtualization.

  • Server lies in the bottom layer, this can be a physical machine or a virtual machine, our Operating system is installed to the server.

  • On top of the operating system a container engine is installed, here it is docker.

  • This container engines allows to run multiple guest instances called containers, we can install application and all it's dependencies within each container
So the main difference between these two models are in Hypervisor virtualization each application is running on it's own copy of the kernel(OS) and  virtualization happens in the hardware level.

In the container based Virtualization single kernal supplies different binaries,runtime to applications running in isolated container.In simple means the container shares the host OS.

This kind of virtualization is called as Operating system level virtualization.

Benefits

Run time isolation.

Thinks you have an two java applications with two different JRE's can you run these two applications in the same virtual machine ?

We can solve the problem by installing two different JRE's in seperate containers
  1. More cost effective - you don't need an entire virtual machine, only the required dependencies are needed to run the application.

  2. Easy and faster deployment

  3. No compatibility issues.

Now Let's have a overview of how docker is working.

Image credit docker.com[/caption]
  • Docker uses a client server architecture, docker users interact with docker through docker client.

  • Docker client is the primary user interface to docker. ( Docker cli and Kitematic )

  • In a Linux environment docker client and the docker daemon (docker server) runs on the same host.


  • You cannot run docker Natively in windows or OS X


  • In Windows and OS X docker daemon is running inside a docker machine.

  • Docker machine is a light weight virtual machine made to run the docker daemon.
       -  We'll talk about some important concepts/keywords in docker.

Docker Images.

  • Docker image is a template need to build a docker container.

  • Images are created using docker build command.

  • Images are composed with layers with other images to increase re-usability, decrease disk usage and speed up docker build by allowing each step to be cached.

  • Images are stored in Docker Registry. (Docker Hub)

Docker Containers.

  • Containers are created from images.

  • Containers provide lightweight, portable environment to run applications.

  • Inside the container it has all the dependencies need to run the application.

Docker registry and Repository.

  • Registry is the place where we store our docker images. We can you Docker Hub or your own registry.

  • Docker Repository is the collection of different docker images with the same name. that differentiate by tags. Tags are simply represent the versions of that image.

References :


Explore More, Thank you !!!

Comments