What is the mechanism of the virtualization tool 'Docker' that enables you to reproduce the same environment and move applications anywhere?



Docker is one of the virtualization software which is rapidly spreading since it appeared in 2013. I briefly summarized "What is integral docker?"

Docker - Build, Ship, and Run Any App, Anywhere
https://www.docker.com/

In order to understand Docker, the Docker developer Solomon Hykes' lecture movie is helpful.

Introduction to Docker - YouTube


As shown in the upper half of the figure below, in modern times large and small items are being transported from wooden boxes to cars and pianos. Not only various things are being transported, but also means for carrying things like the lower half of the figure below are various from railroad, ship and so on.


If you think about "what means to carry with what means", there are countless combinations and dust will disappear.


Containers were created there. Depending on the invention of the container, any container can be used for any type of transportation as long as it is a container.


Even in the IT world, there are various choices as to what to "move" and "where" to move.


Applications that run on your laptop do not necessarily work on servers as well. There are countless things to consider, such as different Python versions, different environment variable settings, etc.


That's where Docker comes in.


In the real world it is a container that is used to unify the format of transport means, but by storing applications in containers according to the mechanism of Docker in the IT world, we can reproduce the same environment anywhere and operate the application You will be able to do.


With this in mind, I will look at the mechanism of Docker. First, build a Docker image using "Dockerfile". Dockerfile is a text file containing information such as "which distribution is used" and "how to build the environment". By building based on this Dockerfile you can create a Docker image that can actually be run on Docker. And the thing that executed this image is the Docker container.


It is also possible to launch multiple containers from one image. The environments of containers that operate even if running the same image are separated. By separating containers for each application, you can run it in an environment suitable for each application. It can be said that the container is an integration of the execution environment and the application.


However, it is not always possible to execute any image when actually executing the Docker image, but since the OS's function is used internally, the kernel of the host OS and the container OS must be the same . That is, Linux images can only be run on Linux. Nonetheless, Docker for Windows and Docker for Mac operate on the Linux virtual environment, so there is almost no problem in development. Conversely, since Docker can speed up the operation by using the kernel of the host OS, it became a virtualization tool that can be used even in the production environment.


Examples of actual service construction using Docker are as follows. Multiple containers can be launched from one image so it can be easily scaled.


Although it wrote as "It can be easily scaled," it is troublesome to set up communications when physically placing containers on separate servers, and to start up and drop containers one by one in the first place. It is the cluster management system such as "Docker Swarm" and "Kubernetes (couvernetes)" that worked there.


Using the cluster management system makes it easy to operate and link multiple containers. In the past, only Docker Swarm was officially supported, but as Google, which is making full use of container technology, develops and promotes Kubernetes, Kubernetes is now the de facto standard for cluster management systems I will. Docker officially supports Kubernetes since 2017.

Using such container technology not only improves scalability, but also enables encoding of the execution environment and integration with the application, so that it can develop applications that behave similarly regardless of the host's environment became. Because infrastructure can be constructed and operated easily, it also has the effect of reducing the future technical debt of libraries and other libraries that depend on dependency and can not be updated.

As services provided using container technology, " Pokemon GO " and " AbemaTV " are famous.

in Software, Posted by log1d_ts