What is Docker?
Docker is an open-source containerization technology that will help you to develop, deploy and run your application with its dependencies in a standard unit called Container. They are low weight containers and hence easily portable also they are all isolated from the underlying infrastructure as well is from each other container. This can be run as a docker container in any machine which have the installation of dockers without worry about Operating System.
Benefit of Docker
Docker provides us with a variety benefits which make it famous in applications development, deployment and management.
Here are some key advantages:
Portability: Docker containers bundled an application and its dependencies into a portable container that runs on any infrastructure. As long as an application runs on a different developer’s laptop it will be running in the testing, staging and production (almost) environments.
Isolation: A container provides an isolated environment for an application, so that it does not affect the rest of the system in terms of software versions or dependencies (even more direct than Java). That isolation also adds to security by constraining the impact of flaws.
Scalability: Docker containers scale up and down gracefully with changing load, as soon one node fails other takes over it. This can be very handy in a microservices architectural pattern, where you might need to provision/move around the instances dynamically based on demand expressed.
Efficiency: Containers are less resource intensive than virtual machines as they share the host system’s kernel, rather than running an Environmentally friendly Operating System (OS). This results in faster start-up times and less resource consumption.
If your app runs on Docker, it will work the exact same no matter where you are deploying. This provides more homogeneity and eliminates “it works on my machine” problem to ease debugging & troubleshooting.
Component of Docker
Docker Engine: Docker engine is the core part of docker, which takes care for creation and running containers.
Image: It is a read-only template with the application code and dependencies used for creating containers.
Docker Hub: A cloud-based repository of vault where you can find all the container images and share it too.
Docker File: Script consisting of instructions to build docker image.
Docker Registry: It is a storage distribution system for docker images, where the user can store both private and public images.
Docker Architecture
A client-server architecture is used by Docker. The Docker client communicates to the docker daemon, which does most of the work in building, running and distributing containers. Once started, the Docker client is running with daemon on same system Or we can connect to the docker client from remote locations. The docker client interacts with the daemon using REST API over a UNIX socket or network.
What is Docker Daemon?
By interacting with other daemons, the docker daemon controls all the services. With the help of API requests to Docker, DICOS controls docker objects such as images, containers, networks and volumes.
Docker Client
The docker users communicate to the this through a client (basically they are used by sending shell commands) called as “Dockerclient” Behind the scenes, this docker command is employing Docker API. The Docker client will be talking to any number of daemons. Whenever a docker client executes any command on the terminal then it gives instructions to daemon. The Docker daemon receives those instructions from the docker client in form of command and REST API’s request.