General knowledge about Docker and Docker Swarm (Part 1 – Docker Overview)

Tram Ho

I. What is Docker?

  • Docker is a platform to provide an easier way to build, deploy, and run applications by using containers (on top of virtualization) to package the application.
  • Docker uses containerization virtualization technology to deploy applications into virtualized containers.
  • Docker uses the linux kernel to run containers, on Linux, Docker can use the host machine’s kernel directly; as for Windows and MacOS operating systems – maybe for security reasons, docker cannot directly share the kernel with these operating systems, so on these operating systems docker will create a virtual guest.
  • Container is a software unit that provides a mechanism to package applications, source code, settings, libraries, etc. into a single object. Packaged applications can work quickly and efficiently across different computing environments. From there, it is possible to create a perfect environment where there is everything for the program to work, without being affected by the system’s environment as well as not having the opposite effect on the containing system. it.

II. Docker Components & Benefits

Component

Docker consists of 3 main components:

  • Docker file

A text file without an extension, containing the specifications of a software executable field, the structure for the Docker image. Docker images can be generated automatically by reading the instructions in the Dockerfile. From those commands, Docker will build a Docker image

  • Image A unit of packaging that contains everything needed for an application to run. Image is made up of many layers stacked on top of each other, inside the image is a stripped down operating system and all the dependencies needed to run an application.
  • Container Container is a software unit that provides a mechanism to package applications, source code, settings, libraries, etc. into a single object. Packaged applications can work quickly and efficiently across different computing environments. From there, it is possible to create a perfect environment where there is everything for the program to work, without being affected by the system’s environment as well as not having the opposite effect on the containing system. it.

Each container includes everything needed to run it: code, runtime, system tools, system libraries, settings. Each container is like a real operating system, inside each container will run an application.

III. Steps to use Docker

Containers are meant to make applications easy to build, move, and run. The process of putting an application running in a container can be understood as follows:

  1. First we start with the app code and its dependencies
  2. Create a Dockerfile describing the app, its dependencies and how to run the app
  3. Build Dockerfile to image
  4. Push newly built image to registry(option)
  5. Run container from image

IV. What is Docker Swarm? Docker Swarm Components

Concept:  Docker Swarm is a native clustering tool for Docker. Allows us to gather a number of Docker hosts together into a cluster and we can see it as a single virtual Docker host. Supports the creation and management of containers or Container Orchestration systems

Ingredient:

  • **Swarm (cluster): **a collection of nodes with at least one master node and several worker nodes which can be virtual or physical.
  • Node: Each node of a Docker Swarm is a Docker Host, there are 2 types of nodes:
  • Manager node: Schedule and manage worker nodes.
  • Worker node: work and report back to the manager node.

V. Docker Swarm Benefits & Features

  • Leveraging the power of Containers, scaling the system: container allows developers to deploy applications or services in independent virtual environments, a task that previously belonged to virtual machines.
  • Ensure high service availability: a Docker Swarm has a manager that can assign tasks to Worker nodes. By implementing multiple managers, developers ensure that the system can continue to function even if one of the Manager nodes fails.
  • Automatic Load Balancing: Docker swarm schedules tasks using a variety of methods to ensure that there are enough resources available for all containers, helping to ensure that specified container workloads run on the most suitable host for optimal performance.

References

[1]. How node works

[2]. Docker docs

[3]. Docker là gì?

Share the news now