Docker
Docker is an open-source centralized platform designed to create, deploy and run applications.
Docker uses containers on the host o.s to run applications. It allows applications to use the same Linux kernel as the system on the host computer, rather than creating a whole virtual Os.
We can install Docker on any o.s but the Docker engine runs natively on Linux distribution.
Docker is written in the 'go' Language.
Docker is a tool that performs o.s level virtualization, also known as Containerization.
Before Docker, many users face the problem that a particular code is running in the developer's system but not the user's system.
Docker was the first Release in March 2013. Soloman Hykes and Sebastion Pahl develop it.
Docker is a set of platforms as a service that uses o.s level virtualization whereas VMware uses hardware-level virtualization.
Advantages of Docker
No pre-allocation of RAM.
CI-efficiency- Docker enables you to build a Container image and use the same image across every step of the deployment Process.
Less cost
It is light in weight.
It can run on physical hardware/virtual hardware or the cloud.
We can re-use.
It took significantly less.
Disadvantages of Docker
Docker is not a good solution for application that requires rich GUI.
Difficult to manage a large amount 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 the development o.s and testing o.s are the same if the o.s is different, we should use VM.
No solution for Data Recovery & Backup.
Architecture of Docker
Docker Daemon
Docker daemon runs on the host o.s
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 commands and Rest API to communicate with the Docker daemon.
When a client runs any server command on the docker client terminal, the client terminal sends these docker commands to the docker daemon.
It is possible for the docker client to communicate with more than one daemon.
Docker Host
Docker Host is used to providing an environment to execute and run applications. It contains the docker daemon, images, container, networks, and storage.
Docker Hub/Registry
The Docker registry manages and stores the Docker images.
There are two types of registries in the 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.
In other words, a Single file with all dependencies and configuration required to run a Program.
Docker Container
The container holds the entire packages that are needed to run the applications.
In other words, we can say that the image is a template and the container is a copy of that template.
A Container is like a Virtual Machine.
Images become containers when they run on the docker engine.
Tasks
Use the docker run
command to start a new container and interact with it through the command line. [Hint: docker run hello-world]
The docker run
the command is used to create and start a new Docker container.
Use the docker inspect
command to view detailed information about a container or image.
The docker inspect
the command is used to obtain detailed information about a Docker container, image, network, or volume.
Use the docker port
command to list the port mappings for a container.
The docker port
the command is used to display the public-facing port mapping for a running Docker container.
Use the docker stats
command to view resource usage statistics for one or more containers.docker stats
is a command in the Docker CLI (Command Line Interface) that allows you to view real-time resource usage statistics for one or more running Docker containers. It shows information such as CPU usage, memory usage, network input/output, and container ID, among other things.
Use the docker top
command to view the processes running inside a container.
The docker top
the command is used to display the running processes of a container. It provides a list of all the processes running inside a container, along with their process ID (PID), user, CPU usage, and memory usage.
Use the docker save
command to save an image to a tar archive.
The docker save
the command is used to save one or more Docker images to a tar archive. The output of this command is a tarball that can be used to transfer images between different Docker hosts or to create a backup of images.
Use the docker load
command to load an image from a tar archive.
The docker load
the command is used to load Docker images from a tar archive created with the docker save
command. It takes a tar archive containing one or more Docker images and imports them into the Docker image store.
Thank you!! ๐