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