Overview of Docker
Containerization in Docker
What is Docker ?
Docker is an open-source software that enables microservices and containerization of software applications. It’s a light weight container service that consists of source code with dependencies bundled up together.
Docker includes components such as Docker client, Docker server, Docker machine, Docker hub, Docker composes, etc.
Docker Feature :-

Docker Workflow :-

Virtualization :-
It refer to creating your virtual resources like creating server, cpu, network etc. we can ccreate multiple sub-machines that can be used to host applications.
It helps us to create our own environment with our requirement which we want we can add those.
· Create multiple env in same physical sys.
· It is easy to clone VM.
· It allow to run multiple VM at a same time.
· It reduces infrastructure cost.

NOTE:- Initially Docker was launched for the unix based platform. But now it is available for other platform to(centos, ubuntu, red hat ).
Docker is available for desktop too it support for the windows and mac os. Need minimum 4GB ram for installations.
Docker Architecture :-
Architecture is quite simple as shown below in the dig:-

Client :-
· Used to maintain and manage images and container on docker host.
· Client is CLI connected to docker host.
Docker Daemon:-
· It is kind of background process running on server and it keeps docker images up and running.
· It is main central part of docker because if this is down all hosted application will be down.
Docker Registry :-
· Used to store your images.
· You can download public images from there.
What is docker Images ?
An image is a read-only template and immutable with instructions for creating a Docker container.
A docker image is described in text file called a Dockerfile, which has a simple, well-defined syntax. An image does not have states and never changes.
Docker Engine provides the core Docker technology that enables images and containers.
It have basic OS binaries.
We can store this images on docker hub or private repo.
Smaller in size.
What is docker Container ?
It consist of the docker images. If wee bundle many images it become container even single image is enough to make 1 container.
It contain OS, N/w and env configurations.
Can host multiple application at once.
Lifecycle :- stopped, restarted, kill

How to execute docker images?
Some command information are given below :-
· To list all images you can use docker images.
· To pull docker images you can use docker pull imagename:tag.
· In docker pull it will search that image on your local if not found it will search on the docker hub.
· Example how to list the docker images:-

·
· To remove the docker images : docker rmi imagename:tag
· To run the docker images : docker run d imagename (one can run the docker images in the many mode).
· To start, stop, kill docker stop container id similar for all.
What is dockerfile ?
· It is udes to build custom docker images. We can add, install, configure the application in docker images using docker file.
· There are few attributes with which we need to be familiar :-
· FROM,CMD,SHELL,COPY,MAINTAINER,ADD,RUN,ENV,COMMAND,WORKDIR,EXPOSE etc.
· The above instruction are not case sensitive but try to follow the convention.
· Statement begin with the # will treated as the comment.
· Docker build command is as follow :- docker build -t imagenameWithPath:tag
Taking the example of the docker file.
Suppose there is a task to install the mysql in ubuntu and we need to create the image of it. So how will be docker file ?
Create your own directory on your local.
Now goto that dir and create the docker file
FROM ubuntu
LABEL maintainer =pratik08.r@gmail.com
RUN apt-get update
RUN apt-get install -y mysql-server
CMD[“echo”,”Image created”]
Now go to dir where you have saved this file make sure you save with the Dockerfile and then execute docket build -t imagename
What is need of docker build ?
Once you create docker file we need to create the docker image so we use docker build command.
Rest will continue in next blog