Install
Desktop version: https://www.docker.com/products/docker-desktop
Here I installed the desktop version and selected windows.
Preliminary work
1. Press win+s (find this)
Check the box below. If you are a home version, you may not have this thing, so please read my article. This article teaches you how to install it.
https://blog.csdn.net/SpongeBob_shouse/article/details/128761045?spm=1001.2014.3001.5502
2. Check the items in the screenshot below
If not, follow the steps below.
Open Microsoft store
to download ubantu
If you cannot open Ubuntu after downloading, you need to check to see if your wsl version is 1 or 2.
If it is 2, you will not be able to open it.
Check whether your version is installed successfully
Note that this version needs to be version 2.
Here’s how to upgrade .
wsl -l -v 查看当前的版本
wsl.exe --set-version Ubuntu 2 升级为2的版本
3. If you follow me and complete the above operations,
open your docker container
and select the settings in the upper left corner, but you may always be in the loading process.
If you enter the settings page and it is always loading,
like me, enter the following command under your powershell.
If it is still loading after the input is completed, you can close your docker desktop and try opening it again. If
it doesn't work, try a few more times.
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon
Then when you can successfully enter.
Find this page and copy the following code into it. Here we will help you configure the docker image.
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"features": {
"buildkit": true
},
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn",
"http://hub-mirror.c.163.com",
"https://registry.docker-cn.com"
]
}
4. At this time, try to start your redis. If it succeeds, it means it is OK.
Record your own pitfalls! ! ! ! !