Showing posts with label Virtualization. Show all posts
Showing posts with label Virtualization. Show all posts

Saturday, April 18, 2020

Docker Introduction

Docker Introduction

  • Docker is an Open Source Platform designed to build, distribute and run applications inside the container.
  • Docker is Virtual box that packages applications.
  • Docker implements a high level API to proceed the light weight containers that run processors.
  • Also Docker is a tool for "Rapid Application Development"
  • Docker will use in Dev, Testing, Stage but before will not use in production because of security reason.
  • But now Docker itself has clearances, They integrated with SE-Linux(know that is for Security purpose).


Virtual Machines Vs Containers

                            VM's                                                          Docker Containers
   

                 -> More time to Create                               -> Less time to create

                 -> Dedicated OS                                        -> Common OS

                 -> Specific bin/lib                                       -> Common bin/lib

                 -> Dedicated Resources                              -> Common resources

                 -> Memory wastage                                    -> No Memory Wastage

                 -> Low Performance                                   -> high performance

                 -> Complex Configure                                -> Simple Configuration

                 -> Heavy Weight (Gb's)                              -> Light Memory (Mb's)

                 -> Memory can not share                             -> Can Share Memory

Docker Core Terminology

Docker mainly have Core parts. Those are

                   ** Images
                   ** Containers
                   ** Dockerfile
                   ** Docker Volumes
                   ** Docker Compose
                   ** Docker Network

Docker Images: 

  • Docker image is a collection of files and source meta data.
  • Images are made of layers, Conceptually stacked on top of each other.
  • Images can share layers to optimize the disk usage, transfer times and memory usage.
  • Docker image is Read Only file system.

Docker Containers:

  • A container is an executable form of docker image.
  • A Container is an encapsulated set of processes running in read-write copy of the file system.

Dockerfile:

  • Creates images automatically by using a build script: <Dockerfile>
  • Can be versionized in a version control system like Git or SVN along with all dependencies.
  • Docker hub can automatically build images based on dockerfiles on GitHub.

Docker Volumes:

  • In Docker, we have a separate volume that can shared across containers. These are known as Data Volumes.
  • They are initialized when the container is created.
  • They can be shared and also reused among many containers.
  • Any changes to the volume itself can be made directly.
  • They exist even after the container is deleted.
          Ex: # docker run -it -v /root/files:/files ubuntu

Docker Compose:

  • Docker Compose is a tool for defining and running multi-container Docker applications.
  • With Compose, we use a compose file to configure application's services.
  • Then, by using a single command we can create and start all the services from the given configuration requirement.
Docker Network: 
  • To communicate Docker Containers with each other and the outside world via the host machine, there has to be a layer of networking involved.
  • Docker supports different types of networks, each fit for certain use cases.
  • Different Network Types    
       Docker comes with network drivers geared towards different use cases. The most common network types being:
  • Bridge
  • Overlay
  • Macvlan

Run Platforms:

  • Various Linux Distributions (Ubuntu, CentOS, Fedora, RHEL, OpenSUSE, ...)
  • Cloud (AWS, GCP, Rackspace)
  • 2014-10: Microsoft announces plans to integrate Docker with next release of Windows Server.
  • 2013-03: Releases as Open Source Tool.



Featured Post

Ansible Tool Introduction

                                                                                                                                    Next ...