Introduction to Docker, installation and common problems during the installation process

What is Docker?

Docker is for one usepackaging,dividing,< /span>tooldepartment

You can also think of it as a lightweight virtual machine. It only virtualizes the running environment your software needs, and doesn’t need anything extra.

An ordinary virtual machine is a complete and huge system, including all kinds of software whether you want it or not.

Packaging: It means to package the dependencies, third-party libraries and software required to run your software together into an installation package.

Distribution: You can upload your packaged "installation package" to a mirror warehouse, and others can easily obtain and install it.

Deployment: With the "installation package", you can run your application with one command, automatically simulating the exact same operating environment, whether it is Windows/Mac/Linux .

Comparison with ordinary virtual machines

characteristic

Ordinary virtual machine

Docker

Cross-platform

Usually it can only run on desktop-level systems, such as Windows/Mac, and cannot run on servers without graphical interfaces.

There are many supported systems, including all types of Windows and Linux.

performance

The performance loss is large and the memory usage is high because the entire complete system is virtualized.

Good performance, only virtualizes the running environment required by the software, minimizing useless configurations

automation

Need to install everything manually

One command can automatically deploy the required environment

stability

The stability is not high and there are big differences between different systems.

Good stability, different systems can be deployed in the same way

Install

download link:

桌面版:https://www.docker.com/products/docker-desktop

Server version:https://docs.docker.com/engine/install/#server

After downloading the desktop version, follow the prompts and click Next to install it. However, you may encounter some problems during the installation of the Windows version (especially when installing in a virtual machine). Let me share the solution below:

1. Start error reporting

Reason for error:

The virtualization of the win environment is not turned on. This problem is common in the win system installed in the virtual machine (it is not installed in the system)

solution:

(1) Control Panel->Programs->Enable or turn off windows functions, turn on Windows virtualization and Linux subsystem (WSL2)

Open the cmd command line and perform the following operations

(2) Install the Linux kernel from the command line: wsl --install -d Ubuntu

(3) Set to start the Hypervisor at boot (administrator rights required): bcdedit /set hypervisorlaunchtype auto

(4) Set the default version 2: wsl --set-default-version 2

(5) Make sure virtualization is turned on in the BIOS. Check whether it is turned on in the picture below.

PS: If virtualization is disabled, please press F2 when booting to enter the BIOS and turn it on. If you don’t know how to set it up, you can search online for how to set up your motherboard.

2. During the installation process, the following error message appears

Reason for error:

The system is not missing wsl 2 tools

solution:

Click the link to install the latest wsl 2

https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

Guess you like

Origin blog.csdn.net/m0_54701273/article/details/129236552