“This is the sixth day of my participation in the Gwen Challenge in November. Check out the details: The Last Gwen Challenge in 2021.”

Hello, I’m looking at the mountains.

Jakob Jenkov’s Docker Tutorial introduces what Docker is and what it does. At work, there may be professional operations students managing server images or other content, but without understanding these concepts, many times we don’t get the full picture of the system.

Docker is a way of packaging application and server configurations into Docker images, using a simple packaging specification called Dockerfile. Docker images can start multiple instances, which are called Docker containers. This series covers what a Docker image is, what a container is, what a Dockerfile is, and how to create, run, and publish it.

The advantage of the Docker

The biggest benefits of using Dockerfile to package application and server configurations are:

  • Never forget how the server is configured, and this configuration information is recorded in a Dockerfile.

  • It’s easy to run applications on a brand new Docker host by deploying the Docker image of the application to the Docker host and launching it.

  • You can easily manage Docker containers in a cluster using Kubernetes and Swarm.

  • At present, many cloud server platforms can easily deploy Docker container, and Docker has become a more independent deployment scheme for cloud.

  • Docker containers can be easily implemented on the client’s own server according to your application.

What is a Docker container

The Linux operating system has several features: Running containerized applications on top of the operating system. These containerized features separate the file system and network from each other among the containerized applications. In other words, one containerized application cannot access the file system or network of another containerized application unless special configuration is added to allow this operation. Docker uses the containerization features of Linux and exposes them through a set of easy-to-use tools.

What is a Docker container

Docker containers vs. virtual machines

A Docker container is essentially similar to a virtual machine, except that the virtual machine has an additional operating system on the total stack. That is, a virtual machine has a full operating system, and the virtual machine runs on a host that has an operating system.

Docker container is different from virtual machine in that it does not have its own operating system and runs directly in the operating system of the host. So, the Docker container is small enough because it does not contain a virtual machine operating system. The Docker container also works well because it does not require virtualization of virtual machines.

Docker containers vs. virtual machines

Dockerfile

As mentioned earlier, we can specify what to include in the Docker container through a rule-defined Dockerfile file. Dockerfile contains a set of Docker commands executed by the Docker command line tool. The result of executing the Dockerfile is a Docker image. We can get a more detailed explanation from the Dockerfile tutorial. [Translator’s note: This link will be replaced when subsequent translations are completed.]

Docker mirror

When the Docker command line tool executes instructions according to the structure defined in Dockerfile, it produces a portable, runnable Docker image. This Docker image contains all the files and instructions required by Docker containers. The same Docker image can start multiple Docker containers.

Docker mirror

The Docker warehouse

Docker images can be stored in a Docker warehouse, a storage warehouse that can upload and download Docker images. Docker repositories can be private, where only you or your organization or someone you designate can manage the images, or they can be public, where anyone can manage the images or download the Docker images from them.

A public Docker repository is a good way for potential users to download, install and run software. Just package the application as a Docker image and upload it to the public Docker repository so that your users can access and use it.

Docker company has taken Docker warehouse as a managed service, providing both private and public services. Some cloud services, such as AWS, AZure and Google, also offer Docker warehouse servers that can upload their own Docker images. These images can easily be used in virtual machines on cloud infrastructure or in Kubernetes.

The Docker warehouse

Docker command line tool

When Docker is installed on the operating system, the Docker command line tool is also installed. Docker command line tool can build Docker image through Dockerfile, Docker image can be uploaded to the Docker warehouse, Docker image can be downloaded from the Docker warehouse, You can start or stop a Docker container by manipulating the Docker image.

Docker Compose

Docker Compose provides a feature that links multiple Docker containers into a combination, and all of the containers in the combination can be deployed or stopped at once. For example, a Docker container running application, a Docker container running database, application depends on the database, at the same time start or stop, can realize the application depends on the database is not running properly.


Hello, I’m looking at the mountains. Swim in the code, play to enjoy life. If this article is helpful to you, please like, bookmark, follow. Welcome to follow the public account “Mountain Hut”, discover a different world.