Windows 上docker 使用期间报错,随笔记录
1. 错误信息:
C:\Windows\system32>docker ps
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/containers/json": open //./pipe/docker_engine: The system cannot find the file specified.文章来源:https://www.toymoban.com/news/detail-859371.html
2. windows上 docker 可启动,但 docker desktop 无法启动,执行 docker Version,报错如上,并且只显示 Client 相关信息,无法显示server,
文章来源地址https://www.toymoban.com/news/detail-859371.html
3. 最终问题原因:wsl 版本过老,执行以下命令进行更新版本。
1. cmd 窗口 升级 wsl
2. 升级完成后,restart machine
# C:\Users\mag>wsl --update
正在检查更新...
正在下载更新...
请求的操作需要提升。
C:\Users\mag>
4. 重启机器后,验证结果
1. 重启后先启动docker
# 查询docker 是否启动
C:\Users\magx>sc query com.docker.service
SERVICE_NAME: com.docker.service
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
C:\Users\magx>
##########################################################
<Note: 如未启动执行启动命令 # sc start com.docker.service>
##########################################################
2. 重启后启动 docker desktop
3. 验证 docker ps or docker version
C:\Users\magx>docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c24adaf755fe grafana/grafana:latest "/run.sh" 5 weeks ago Up 19 seconds 0.0.0.0:3000->3000/tcp grafana_promtail_loki_demo_grafana
d501919cae77 timberio/vector:0.10.0-alpine "/usr/local/bin/vect…" 5 weeks ago Up 18 seconds 0.0.0.0:80->80/tcp grafana_promtail_loki_demo_vector
08c3ae5a2cf9 grafana/loki:latest "/usr/bin/loki -conf…" 5 weeks ago Up 19 seconds 0.0.0.0:3100->3100/tcp grafana_promtail_loki_demo_loki
C:\Users\magx>
C:\Users\magx>docker version
Client:
Cloud integration: v1.0.29
Version: 20.10.21
API version: 1.41
Go version: go1.18.7
Git commit: baeda1f
Built: Tue Oct 25 18:08:16 2022
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Desktop 4.15.0 (93002)
Engine:
Version: 20.10.21
API version: 1.41 (minimum version 1.12)
Go version: go1.18.7
Git commit: 3056208
Built: Tue Oct 25 18:00:19 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.10
GitCommit: 770bd0108c32f3fb5c73ae1264f7e503fe7b2661
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
C:\Users\magx>
到了这里,关于Windows Docker 使用期间出错的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!