Day 16: Docker for DevOps Engineers.

Day 16: Docker for DevOps Engineers.

Day 16 of 90daysofdevops

ยท

4 min read

Docker

  1. Docker is an open-source centralized platform designed to create, deploy and run applications.

  2. 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.

  3. We can install Docker on any o.s but the Docker engine runs natively on Linux distribution.

  4. Docker is written in the 'go' Language.

  5. Docker is a tool that performs o.s level virtualization, also known as Containerization.

  6. Before Docker, many users face the problem that a particular code is running in the developer's system but not the user's system.

  7. Docker was the first Release in March 2013. Soloman Hykes and Sebastion Pahl develop it.

  8. Docker is a set of platforms as a service that uses o.s level virtualization whereas VMware uses hardware-level virtualization.

Advantages of Docker

  1. No pre-allocation of RAM.

  2. CI-efficiency- Docker enables you to build a Container image and use the same image across every step of the deployment Process.

  3. Less cost

  4. It is light in weight.

  5. It can run on physical hardware/virtual hardware or the cloud.

  6. We can re-use.

  7. It took significantly less.

Disadvantages of Docker

  1. Docker is not a good solution for application that requires rich GUI.

  2. Difficult to manage a large amount of containers.

  3. 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.

  4. 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.

  5. No solution for Data Recovery & Backup.

Architecture of Docker

What Is Docker? A Beginner's Guide | JFrog

Docker Daemon

  1. Docker daemon runs on the host o.s

  2. It is responsible for running containers to manage docker services.

  3. Docker Daemon can communicate with other daemons.

Docker Client

Docker users can interact with the docker daemon through a client (CLI).

  1. The Docker client uses commands and Rest API to communicate with the Docker daemon.

  2. When a client runs any server command on the docker client terminal, the client terminal sends these docker commands to the docker daemon.

  3. 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!! ๐Ÿ˜‰

~RITUL GUPTA

ย