1.安装docker desktop
docker官网下载docker
安装完之后重启
2.windows的相关配置
(1)任务管理器的虚拟化是否开启
(2)win+r输入control,打开启用或者关闭windows功能,
把Hyper-V中的选项全部打开
这里要注意一下,如果没有Hyper-V,就新建一个文本文档,命名为Hyper.cmd
输入内容为:
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
点击运行一下就Ok啦
(3)最后在下载一个Linuux内核更新包(WSL)
http://链接: https://pan.baidu.com/s/1Riyj42JREgAWdSgMktyr5A 提取码: 1314
3.docker相关配置
(1)打开Docker Engine -> 右侧输入框 -> Apply & Restart,配置镜像加速
{
"registry-mirrors": [
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn"
],
"insecure-registries": [],
"debug": false,
"experimental": false,
"features": {
"buildkit": true
},
"builder": {
"gc": {
"enabled": true,
"defaultKeepStorage": "20GB"
}
}
}
(2)打开命令提示符
输入docker --version
docker安装成功