Today we are going discuss about what is docker. But before that let's discuss what are Virtual Machines and also let's discuss what is containerisation.
VMware
In the initial days one application used to run on one server. This problem was solved by VMware also known as virtual machines. You could run multiple apps on it. But it had some problems. The biggest problem was Virtual machines required their Operating system.
Hypervisor: It is used to create multiple machines on the host operating system and it manages virtual machines.
Containers
Containers are similar to virtual machines but here you do not require multiple operating systems.
Ok so coming to Docker...
Docker is a tool that creates this virtual machine. Docker is an advanced version of virtualization.
Docker is a tool that performs O.S.-level virtualisation, also known as containerisation.
Before Docker, many users faced problems that a particular code is running in developers but not in the user's system.
Docker was first Released in March 2013. It was developed by Solomon Hypes and Sebestian Dahl.
Docker is an open-source containerised platform designed to create, deploy and run applications. Docker uses a container on the O.S. to run applications.
It allows applications to use the same Linux kernel as a system on the host computer, rather than creating a whole virtual O.S
We can install docker on any OS but the docker engine runs natively on Linux distribution.
Docker is purely built to run on Linux but for running on Windows we have to download the Docker engine tool which has all Linux commands on it.
Docker is written in the 'go' language.
Docker is a set of platforms as a service that uses O.S level virtualisation whereas VMware uses hardware-level virtualisation.
There are 3 types of services
Internet as a service
Platform as a service
Software as a service
Advantages of Docker
No pre-allocation of RAM
Continuous integration Efficiency: Docker enables you to build a container image and use the same image across every step of the deployment process.
Less Cost
It can be light in weight (An application that requires less resources to run).
It can be on physical H/W, virtual H/W or on cloud.
You can re-use the image.
It takes very less time to create a container.
Disadvantages of Docker
Docker is not a good solution for application that requires rich GUI.
Difficult to manage a large number of containers.
Docker does not provide cross-platform compatibility means if an application is designed to run in a docker container on Windows, then it can't run on Linux or vice-versa.
Docker is suitable when development O.S is different, we should use VM.
No solution for Data Recovery and Backup.
Docker Daemon
Docker Daemon runs on the host Operating System.
It is responsible for running containers to manage docker services.
Docker Daemon can communicate with other daemons.
Docker Client
Docker users can interact with the docker daemon through a client(CLI). The Docker client uses command and Rest API to communicate with Docker daemon. When a client runs any server command on the docker client terminal, the client terminal sends that docker command to the docker daemon. It is possible to communicate with more than one daemon.
Docker Host
Docker host is used to provide an environment to execute and run environment to execute and run applications. It contains the docker daemon, images, containers, network and storage.
Docker Hub/Registry
The Docker registry manages and stores the Docker images.
There are two types of registries in docker:-
Public registry: Public registry is also called a docker hub.
Private registry: It is used to share images within the enterprise.
Docker images
Docker images are the read-only binary templates used to create docker containers.
Ways to Create Docker Image
Take an image from Docker Hub.
Create images from the Docker file.
Create images from existing docker containers.
Docker Container
The container holds the entire package that is needed to run the application In other words, we can say that the container is a copy of that template. The container is like a V.M. and Images become containers when they run on the docker engine.