Article directory
1、wsl
1.1. What is wsl
Official documentation of virtualization tools from Microsoft :
WSL 2 is a new version of the Windows Subsystem for Linux architecture that supports Windows Subsystem for Linux running ELF64 Linux binaries on Windows.
2. Recommended method to install wsl in windows 11
My win11 version
2.1. Open the two functions of window and restart
-
In Control Panel-Programs-Turn on or off window functions
-
Check the corresponding function
. After confirmation, you need to restart the computer.
2.2. Install Linux distribution
Search for wsl in the Microsoft Store, find the following icon, and download and install it.
After installation, enter wsl -l -v in powerShell to view the version.
Note: What if a bunch of Ubuntu files appear when you open it? ? ? ? , just enter the following command in PowerShell to install the kernel, and then set the user name and password
wsl --update
2.3. How to start Ubuntu
Method 1: Enter wsl directly in PowerShell to start
Method 2:
3. Use in conjunction with vsCode
3.1. Install wsl in vsCode toolkit
3.2. The corresponding remote resource management icon appears in vscode.
4. View the internal files of Linux in Windows 11
That is, Ubuntu’s internal file system
5. Install docker in window11
Method 1: Install Docker Desktop in Windows (large memory consumption)
Method 2: Install Docker Engine in WSL (Ubuntu) (recommended)
5.1. Install Docker Engine in wsL (Ubuntu)
- Open the official website
- Find the Ubuntu installation page for Docker Engine
- Follow the prompts and install using apt
Notice
The Ubuntu we installed does not come with Gul, so we installed Docker Engine instead of Docker Desktop
Official website location: https://docs.docker.com/engine/install/ubuntu/After
successful installation
5.2 Install nginx
// Ubuntu 中安装nginx
docker pull nginx:latest
docker run --name ng -dp 8080:80 nginx:latest
// 启动docker
sudo service docker start
Official website of nginx: https://hub.docker.com/_/nginx
You can download the image of the desired version