docker desktop 安装踩坑纪要


win10 家庭版,原本系统更新后可以直接安装docker desktop并正常运行,无奈安装了个手机模拟器后,docker desktop启动不了...

启动后提示:
Hardware assisted virtualization and data execution protection must be enabled in the BIOS. See https://docs.docker.com/docker-for-windows/troubleshoot/#virtualization

命令行执行docker version,错误提示:
error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version": open //./pipe/docker_engine: The system cannot find the file specified.

提示说是没有足够的权限执行docker守护进程连接...
想着会不会是安装手机模拟器时提示跟hyper-V冲突,果然,查看系统hyper-V服务找不着了,
接着,安装并启用hyper-V,

(参考 win10安装hyper-V 链接:https://www.cnblogs.com/go-wandering/p/15418781.html)

打开docker安装目录,开启docker守护进程,问题终于解决了

注意,还有可能是WSL2没安装(WSL2安装好后记得重启),记得查看新生成的虚拟子系统,除了默认的

执行docker-compose -f openresty.yml up -d
错误提示
ERROR: In file '.\openresty.yml', service 'image' must be a mapping not a string.
检查yml 文件缩进问题

容器没有stop 修改了bios,重启电脑后,陷入stoped,restart,然后软件关闭

命令行执行docker version,错误提示
It looks like there is an error with Docker Desktop, restart it to fix it

根据提示重启:
docker : error during connect: In the default daemon configuration on Windows,
the docker client must be run with elevated privileges to connect.:
Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version"
: open //./pipe/docker_engine: The system cannot find the file specified

连接受阻,系统无法找到指定的文件

以管理员身份运行
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon
发现没有效果

查看虚拟化开启(任务管理器 > 性能)
查看Hyper-v开启(控制面板 > 程序 > 启用或关闭windows功能),发现未勾选,问题所在

诡异问题:Docker Desktop 一直在start,stoped,quit

1、检查虚拟化:windows系统更新后,发现hyper-v未启用,启用它
2、服务权限:
执行docker version 提示
error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version": open //./pipe/docker_engine: The system cannot find the file specified.

权限问题,跟之前 windows 守护进程一致,执行命令后发现依旧无效

3、查看了日志文件:C:\ProgramData\DockerDesktop\service.txt
Daemon has completed initialization
API listen on //./pipe/docker_engine_windows
Daemon shutdown complete

开启后就关闭了,循环状态

4、临时解决:删除配置文件,重新开启Docker Desktop,成功启动了,本地镜像文件也没丢失
系统配置文件路径:C:\Users\Admin\AppData\Roaming\Docker\settings.json

settings.json文件:autoStart、useWindowsContainers 两项值有变动
启动容器后,跳过引导,这个文件又更新了...无语的是,每次启动软件都需要重复步骤4,真的是够了....

5、搜索同目录文件,发现
http代理配置文件:C:\Users\Admin\AppData\Roaming\Docker\http_proxy.json
"allow_error_msg": "Access to %s is restricted by your Docker organization. To access this registry, ask your Docker administrator to add it to your organization's allowed registries."
大概意思是注册表访问没权限

终极大法: win+R,打开终端输入services.msc,将Hyper-V部分服务设置为自动延迟开启

电脑自动更新后,打开软件,根据提示,start正常了


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM