Docker is an open source, lightweight container engine, mainly running on Linux and Windows platforms, used to create, manage and orchestrate containers. Compared with VMware virtual machines, Docker uses containers to host applications instead of operating systems, so it has very little overhead and high performance. However, Docker's isolation of applications is not as complete as virtual machines, so it cannot completely replace VMware.
System platform: win10 professional edition
Note: Since Docker requires WSL2 and BIOS virtualization technology support, it is necessary to manually restart the computer multiple times during the configuration process.
1. Download the installation package of Docker and WSL2
1.1 Download Docker
address: https://desktop.docker.com/win/stable/Docker%20Desktop%20Installer.exe
1.2 View system information
Press win+R, enter CMD, enter systeminfo in the black box, as follows:
Find the item "System Type" and find that it is x64, so you need to download the x64 version of WSL2. But if your system type is amd64, you only need to download the amd64 version of WSL2.
WSL2 x64 version
WSL2 amd64 version
2. Enable developer mode
Click [Start] in the lower left corner of the desktop --> Settings --> Update and Security --> Developer Options --> Check the developer mode, as shown in Figure (2):
3. Check Hyper-V and "Windows Subsystem for Linux" in the control panel
Open the control panel --> Programs --> enable and disable the Windows function, check the following 2 items:
√ Hyper-v
√ The Windows subsystem for Linux is
shown in Figure (3) and Figure (4):
4. Turn on virtualization support in the BIOS
- The assembly machine is divided into motherboards, ASUS press F8, Intel press F12, other brands press ESC, F11 or F12;
- Notebooks are classified by brand. For Lenovo ThinkPad series, press F1, and for other brands, press F2;
- Brand desktops are classified by brand, Dell presses ESC, HP presses F10, and others press F12;
Here is an HP desktop computer as an example. Restart the computer and keep pressing F10 until it enters the BIOS settings-->Configuration-->Virtualization Technology-->Enable-->Restart the computer, as shown in Figure (5) :
5. Set up and install WSL2
5.1 Setting up the environment of WSL2
Open PowerShell with administrator privileges and enter the following command:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
5.2 Restart the computer
5.3 Install WSL2
Double-click the WSL2 downloaded in section 1.2, all the way defaults, until the installation is complete, you must restart the computer.
5.4 also enable virtualization support for WSL2
Open PowerShell with administrator privileges and enter the following command:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Still have to restart the computer.
5.5 Set WSL2 as the default version
Open PowerShell with administrator privileges and enter the following command:
wsl --set-default-version 2
6. Install Docker
Close the anti-virus software and other programs that take up memory, click on the Docker installation package in section 1.2, all the way to the default, until the installation is complete.
Restart the computer, open PowerShell with administrator privileges, and enter the following command:
docker version
The effect is as follows:
You can check the version of Docker, indicating that the installation was successful.