Docker overview and Docker installation

Docker official website: http://www.docker.com

Docker Chinese website: https://www.docker-cn.com

Docker Hub (warehouse) official website: https://hub.docker.com

Note:

Jetson Orin NX and Jetson Orin Nano use Docker images, while Jetson Nano motherboard does not use Docker images.

1.0, Windows Docker software tool recommendation

It is recommended to use MobaXterm remote tool to connect to the main control

For the installation and use of MobaXterm, please refer to the following link or search Baidu.

1.1, Docker overview

Docker is an application container engine project, developed based on the go language, and is open source.

1.1.1, Why does docker appear

First, let me mention a few scenarios:

  1. The operation and maintenance team deploys the project you developed to the server and tells you that there is a problem and it cannot be started. You run it locally and find that there is no problem...
  2. The project to be launched is unavailable due to the update of some software versions...
  3. Some projects involve a lot of environment content, various middleware, various configurations, and many servers need to be deployed...

In fact, these problems are related to the environment.

To avoid various problems caused by different environments, it is best to deploy the project together with the various environments required by the project.

For example, the project involves redis, mysql, jdk, es and other environments. When deploying the jar package, bring the entire environment. Then the question is, how can the project bring the environment together?

Docker is here to solve this problem!

1.1.2. The core idea of ​​Docker

image-20230424111123951

This is the Docker logo, a whale full of containers. On the whale's back, the containers are isolated from each other. This is the core idea of ​​Docker. For example, if multiple applications were running on the same server before, there might be conflicts in the port usage of the software. Now they can run independently after isolation. In addition, Docker can maximize the use of the server's capabilities.

1.1.3. Comparison between virtual machines and Docker

1.1.4, Docker architecture

Docker uses a client-server architecture. The Docker client communicates with the Docker daemon, which is responsible for building, running, and distributing Docker containers. The Docker client and daemon can run on the same system, or you can connect the Docker client to a remote Docker daemon. The Docker client and daemon communicate using the REST API over a UNIX socket or a network interface. Another Docker client is Docker Compose, which allows you to handle applications consisting of a set of containers.

30f24e4195234f58afbe43525dd57504

1.1.5、Docker core objects

1.1.6、Image, container, warehouse

Image:

Container:

Repository:

It is necessary to correctly understand the concepts of storage/image/container:

1.1.7, Docker operation mechanism

Docker pull execution process:

  1. The client sends the command to the docker daemon
  2. The docker daemon first checks whether there are relevant images in the local images
  3. If there is no relevant image locally, it requests the image server to download the remote image to the local

Docker run execution process:

  1. Check whether the specified image exists locally. If not, download it from the public warehouse
  2. Use the image to create and start a container
  3. Allocate a file system (a simplified Linux system) and mount a readable and writable layer outside the read-only image layer
  4. Bridge a virtual interface from the bridge interface configured on the host to the container
  5. Configure an IP address for the container from the address pool
  6. Execute the application specified by the user

1.2, Docker installation

  1. Official website installation reference manual: https://docs.docker.com/engine/install/ubuntu/
  2. You can use the following command to install it with one click:
  1. Check the docker version

image-20230424113920974

  1. Test command

The following output indicates that Docker is successfully installed

image-20230424113848585