Header Ads

What is Docker - Get Started from Basics - Docker Tutorial

This post will help you to learn everything about Docker from Basics.

End of this post, you will be able to understand,

1. What is Docker?
2. Why do we use Docker,
3. Docker Architecture,
4. Docker Components.

In the previous posts, already we have explained the below topics. Refer those links to understand this topic from basics.

What is Docker - Get Started from Basics - Docker Tutorial
What is Container, What is Docker on Container - Get Started
How to Install Docker on CentOS 7 / RHEL 7
Docker Images Explained with Examples - Docker Tutorial
Dockerfile Instructions Explained with Examples
Docker ONBUILD Command Explained with Examples
Docker ARG vs ENV Command Differences Explained in Detail
Docker CMD & ENTRYPOINT Differences Explained in Detail

Also Watch this "What is Docker" Tutorial video demo on our YouTube Channel.

What is Docker - Get Started from Basics - Docker Tutorial

Lets get started.

What is Docker?

what is docker container

Docker is a opensource platform tool designed to manage the containers, which allow us to build the application in a container with required libraries, binaries, dependencies to run the application, ship the container and run anywhere.

Already explained about the Containerization technology in the previous post, read out to know more about What is Container, What is Docker on Container - Get Started. This session explains only about the docker tool.

What is Docker - Get Started from Basics - Docker Tutorial

Docker really making an impact on the development of new generation applications. How?

Why do we use Docker?

1. Portability - An applications can be bundled in to a single unit and same unit can be deployed to various environments such as dev server, testing server and production server without making any changes to the container.
2. Light Weight - Docker containers are pretty lightweight so it provides a smaller footprint of the operating system via containers.
3. Fast Delivery and Scalable - Since Docker containers are pretty lightweight, So they can be deployed faster and they are very easily scalable.
4. Docker used  for Continuous Deployment and Testing. So With the help of containers, it becomes easier for teams across different units, such as development, QA and Operations to work seamlessly across applications.
5. Docker also provides you, ability to run multiple isolated OS on single host.
6. Resource Optimization - Docker enable you to utilize the maximum resources and reduce the resource wastages of your hardware.

Docker Architecture and Docker Components

Docker Architecture and Docker Components

This image shows you the Docker Architecture with Docker Components where you have docker client, docker host, docker hub, docker images, docker containers.

So Docker Architecture depends on three main components: which are

1. Docker Client
2. Docker Host (Docker Engine)
3. Docker Registry

Also we have other components
4. Docker Images
5. Docker Containers
6. Docker Network
7. Docker Storages

Docker Client
Docker client is used to manage the docker components such as containers, images, networks, storage volumes by giving the specific instructions to perform some operations like build, pull, create, run, delete, stop, restart,.

So Docker client interacts with the docker host where docker daemon (dockerd) is installed, ie Docker Host.

Its not neccessary that Docker Client must be available at the Docker host, it can also be used from the remote machine to manage your docker host. The Docker client and Docker daemon can be communicated each other using a REST API, over UNIX sockets or a network interfaces.

Docker Host (Docker Engine)
Docker host is the server where the Docker Daemon is running and it manages the docker containers and other resources. It listens and accepts the requests from Docker Client.

Docker Registry - Docker Hub
Docker registry or Docker Hub is a repository to manage the Docker images. So this will allow us to push or pull the Docker images which means you can download or upload the images..

There are two types of docker registry available,

1. Docker hub - It is available in internet, Maintaining by Docker company in cloud. We can download (pull) the publicly available images or also we can upload(push) the images to Docker Hub online. We have two services available with docker hub ie public and private. If you want your images to available to everyone, set it to public. If you want your images only to you, set it to private.

2. Local Docker Hub - Its available locally within the organization. By default if we pull the images, it checks the local docker hub regsitry. If not finds the requested images locally, then it goes to download from online docker hub.

Docker Images
Docker Images are a just templates, it is very similar to snapshot image.
Docker images can be used to create the containers. It is a read only layer.
Docker Images can be created from the container once you have done the changes on the container or you can create the Docker Images using a Dockerfile with specific instructions. So these Docker Images are very lightweight, small, and fast to deploy the containers.

Docker Containers
Docker Container's are actually a executable run-time light weight operating system.
Docker Container is a read/write layer of a Docker Images.
Docker containers can be created using a docker images also we can create a docker images from a docker container once the required modification is done.

Docker Network
Docker network enables the network to communicate with other containers. By default, we have three networks created when you have installed docker.

1. Bridge - This is the default network driver attached to the container during the container creation if you didnt specify other network. So any containers on the same network can be communicated with other containers.
2. Host - It allows a container to directly attached to the docker host network. It can be used to have a standalone container, so this will not have isolate the network between docker host and docker containers.
3. None - This can be used to disable the networking for the containers. So containers will not have ip address when you have used this network.

Also we have other network drivers can be used for other features.

4. Overlay - also ingress network, it can be used to connect different containers hosted on different docker host or many. Mostly this network automatically used in the docker swarm clustering environment.
5. Macvlan - This network driver used to assign a MAC address to the container, so the container attached with a Macvlan network driver will looks like physical network attched to it. Because there are some application would work only on physical network not on virtual network. On that cases, we can use this network driver.

Docker Storages
Any data written to the docker container will not be available when docker container is removed. So we must use a docker storage to have the data permanently if need.

There are three types of storage available with docker.

Volumes are stored in a part of the host filesystem which is managed by Docker (/var/lib/docker/volumes/ on Linux). Non-Docker processes should not modify this part of the filesystem. Volumes are the best way to persist data in Docker.

Bind mounts may be stored anywhere on the host system. They may even be important system files or directories. Non-Docker processes on the Docker host or a Docker container can modify them at any time.

tmpfs mounts are stored in the host system’s memory only, and are never written to the host system’s filesystem.

Hope you have got an idea about what is docker tool and its components. Refer this link to know how to install docker on CentOS 7 and RHEL 7.

Going forward, we will play more with docker containers.
Support Us: Share with your friends and groups.

Stay connected with us on social networking sites, Thank you.
Powered by Blogger.