My version: Docker version 20.10.0, build 7287ab3
windows version:
After a day of learning about docker, I found out that Hyper-V needs to be supported for installation under windows, but after manually downloading it by myself, it is prompted to prepare before installation. Through this address how to install the latest docker you can find the latest version docker do not need to install Hyper-V in the windows but wsl
specific installation process is not to say you can be installed in accordance with that link. Remember to consider various versions during the installation process. If you have any questions, you can leave a message to discuss.
- What is WSL
WSL 2 is a new version of the Windows subsystem architecture for Linux. It supports the Windows subsystem for Linux to run ELF64 Linux binaries on Windows. Its main goal is to improve file system performance and add complete system call compatibility.
- Error message after installation
error during connect: This error may indicate that the docker daemon is not running.: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json: open //./pipe/docker_engine: The system cannot find the file specified
- solution
Reference address : docker official
Open and execute in the PowerShell administrator:
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon
- Use Ali to download image acceleration
In our download mirrors when the mirror through its own network address direct access is very slow so we can speed up the download mirror address configuration Ali Click Ali mirrored Get your own image
as shown:
- Change the default download mirror directory of dcoker
The default installation directory is found by searching docker info and found that it is currently in /var/lib/docker, which is in the virtual device of the system, which is what we started talking about. The windows subsystem is a Linux mirror virtual address, so most of the updates on the Internet are changed. Address in linux, what we really want to update is the address of the physical hard disk where the linux image is located. So we need to find the mirror. Started through wsl2, docker will automatically create two subsystems, which can be viewed through wsl --list. The storage location is C:\Users\your username\AppData\Local\Docker\wsl corresponding to two vhdx files. We only need to migrate the location of the mirrored directory where the data is stored and also pulled down to migrate it from the c drive to other unsuitable system drives.
- Create a new storage data address such as D://docker//data
- Stop docker and wsl service
wsl --shutdown
- Export the existing mirrored data
wsl --export docker-desktop-data D:\docker\data\docker-desktop-data.tar
- Log out of docker-desktop-data
wsl --unregister docker-desktop-data
- Re-import docker-desktop-data to the folder to be stored
wsl --import docker-desktop-data D:\docker\data\ D:\docker\data\docker-desktop-data.tar --version 2
- Start wsl at this time
net start LxssManager
- Finally, start docker to check whether the pull image data is in the latest directory