[docker] Install and configure Alibaba Cloud image acceleration under Windows 11 system

[docker] Install and configure Alibaba Cloud image acceleration under Windows 11 system

Tip: The blogger has selected many blog posts from big guys and personally tested them to be effective. He shares his notes and invites everyone to study and discuss them together.

1. Check whether the Windows environment supports docker

Open a command line window and execute the "winver" command.
Insert image description here
Windows environment Docker must be 64-bit, Home or Pro 21H2 or higher, Enterprise or Education 21H2 or higher.

2. Start Hyper-V

Hyper-V is a Microsoft virtual machine that comes with win10, so you can enable Hyper-V through the "Settings" of the control panel: 1. Open "
Control Panel" -> "Programs" -> "Start or shut down Windows Function".

2. Check the Hyper-V option and click "OK":

Win11 cannot find Hyper-V because the home version does not support it because the home version does not have a virtualization function. If you want to enable this feature in Win11 Home Edition, you need to install the component manually.
Open Notepad, copy and paste the following script into a text file, save it as win11-home-hyperv.bat, and run it as an administrator. After the command is finished, press the "Y" key to restart the computer as prompted.

pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL

3. After the installation is complete, restart the computer
. Open the Task Manager, select Performance, click CPU, and check whether the computer has enabled virtualization support. If virtualization is not supported yet, restart and enter the BIOS to enable VT to support CPU virtualization.

3. Official website download and installation

Docker application and data default location settings/changes

If possible, applications (software) and data (image containers) are placed on the solid state drive.

The Docker Desktop application is installed in [C:\Program Files\Docker] by default. The installation location cannot be customized during installation. Use directory links to install the application to other disks:

# 管理员身份运行CMD
# 安装时存放docker应用程序的文件夹
MD "E:\Docker\DockerApp\Docker"
# 在E盘里新建Docker文件夹并链接到C盘
mklink /J "C:\Program Files\Docker"  "E:\Docker\DockerApp\Docker"


Similarly, the two directories under the default storage location of user image files and container data files [C:\Users\xxxx\AppData\Local\Docker\wsl] cannot be customized. As the number of images and containers increases, it will be seriously occupied. C drive space, use directory link to install the application to other drives:

# 管理员身份运行CMD
# 存放用户镜像文件及容器数据文件的目录
MD "E:\Docker\DockerData\Docker"
# 创建E盘Docker数据到C盘的链接
mklink /J "C:\Users\XXXX\AppData\Local\Docker"  "E:\Docker\DockerData\Docker"

Note: When uninstalling docker, the link will be deleted together, so you need to create a new one when reinstalling.

Docker application installation

Download it from the windows-docker official website (recommended)
and install it directly.

After the installation is complete, you need to restart the host.

After the restart is complete, start docker and click "Accept".
The installation is complete.

Docker application installation FAQs

  • Possible problems: "Docker Desktop requires a newer WSL kernel version."

    Solution: Upgrade the WSL2 kernel, close all running wsl2 terminals, and run PowerShell or command line tools as an administrator.
    wsl --update
    
  • Possible problems: Win error when installing updates: 0x80240438 Problem

    solution: Windows Firewall can cause this problem, the only solution is to temporarily disable Windows Firewall and then install updates.
    Win + I to open Settings, select Privacy & Security, navigate to Firewall & Network Protection in Windows Security Center; select your network profile from Domain Networks, Private Networks, and Public Networks (Blogger's Thing Public Networks tagged Use Medium), turn off Microsoft Defender Firewall;

    when finished, close the window and try installing the update again.

4. Configure Alibaba Cloud Image Acceleration

Log in to the Alibaba Cloud official website: Mirror Accelerator ( account login required)

add "https://inhj05a1.mirror.aliyuncs.com" to the array of "registry-mirrors"

{
    
    
  "registry-mirrors": ["https://inhj05a1.mirror.aliyuncs.com"]
}


Click the Apply & Restart button and wait for Docker to restart and apply the configured image accelerator.

5. Commonly used instructions for docker

Reference link

Tip: The blogger has selected many blog posts from big guys and personally tested them to be effective. He shares his notes and invites everyone to study and discuss them together.

Guess you like

Origin blog.csdn.net/yangyu0515/article/details/132035404