DOCKER: D ocker is a tool to run the Application in an isolated environment. Which is used to create, deploy, edit, and run the application ...
DOCKER:
Docker is a tool to run the Application in an isolated environment. Which is used to create, deploy, edit, and run the application as a container.
Configure the docker once and use it anywhere, It is like a virtual machine.
Containers Vs Virtual machine:
Containers are isolated from others and bundle their own software, libraries, and configuration files, packages, Containers are run above the OS(operating system),
So no need for an Extra OS or application.
Run the multiple containers in the same machine and share the kernel with others.
Containers use less space compared to virtual machines.
It will manage the system memory automatically. So no need to worry about memory management.
VM(virtual machines) are used to run multiple operating systems in the same infrastructure using the hypervisor.
Each virtual machine takes much space from the server or infrastructure so memory and usage get slow.
virtual machines were bulk in size, running multiple virtual machines leads to unstable performance, the boot-up process usually takes a long time. Docker has three main and essential parts.
1. Docker File,
2. Image
3. Container
Dockerfile:
A docker file is a Text file and it contains a list of steps and commands executed to build a docker image.
Image:
It has a template to create an environment or docker containers.
A Docker image is made up of a collection of files that bundle together all the essentials, such as installations, application code, and dependencies.
Creating the Docker image have two types:
Interactive Method: In this method running the container by using the existing docker image and manually changing the container's environment and running in the container is one type.
Dockerfile Method: In this method need to create the docker file and create the docker image from the docker file.
Container:
Containers are the final stage for docker, Container contains the combination of image code, and repositories. This can be used to build a development application as well as a production application within the same time frame without configuring the new configuration.
Docker containers are used to reduce the time.
Container Registries:
Container registries are the storage place and it is called repositories.
Using the registries to pull and push container images.
Three main registries in docker:
Docker Hub:
Docker hub is the official Docker image storage location of Docker and it stored more than 10000 container images shared by software vendors and Docker users. Anyone can also use the docker hub service to host and manage their own images.
Third-party registry services: Fully managed offerings that serve as a central point of access to your own container images, providing a way to store, manage and secure them without the operational headache of running your own on-premises registry.
Examples of third-party registry offerings that support Docker images include Red Hat Quay, Amazon ECR, Azure Container Registry, and Google Container Registry.
Self-hosted registries: A registry model favored by organizations that prefer to host container images on their own on-premises infrastructure.
Self-hosted registries are used for security, compliance, or lower latency requirements.
Install the Docker:
Installing the Docker image on centos7
Step 1: To install the docker Epel repositories must be enabled.
Command; yum install epel-release Command: yum install docker-io