bitjian / learn_note

学习笔记
0 stars 0 forks source link

win11安装docker #8

Open bitjian opened 9 months ago

bitjian commented 9 months ago

win11安装docker

安装hyper-v

创建一个hyper.txt,粘贴一下内容

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

重命名为 hyper.cmd ,以管理员方式运行,之后输入y重启
检查 控制面板 - 启用或关闭window功能 发现 hyper-v 功能还有 适用于linux的window子系统 都是勾选状态

image image

安装WSL

在powershell以管理员运行一下命令

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

如果版本太低就升级WSL

wsl.exe --update

下载安装docker

docker下载

配置镜像源

settings里的docker engine配置

 "registry-mirrors": [
    "https://hub-mirror.c.163.com",
    "https://mirror.baidubce.com"
  ]
image
r372801950 commented 3 weeks ago

好用好用