【CS.SE.QA】Docker Desktop报错: running wsl distro proxy in Ubuntu-22.04 distro:exit status 1

问题描述 (Problem Description):

Docker Desktop某一天打开报错, 无法使用docker了

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy

$ root@-PC:/mnt/c/Users/ Lyu# uname -r
6.6.36.3-microsoft-standard-WSL2

$ root@-PC:/mnt/c/Users/Lyu# cat /etc/issue
Ubuntu 22.04.4 LTS \n \l

docker目前版本:

# ls -lh |grep deb
-rw-r--r-- 1 root root  30M Jul 25 11:04 containerd.io_1.7.19-1_amd64.deb
-rwxr--r-- 1 root root  29M Jul 25 11:06 docker-buildx-plugin_0.16.1-1~ubuntu.22.04~jammy_amd64.deb
-rwxr--r-- 1 root root  14M Jul 25 11:06 docker-ce-cli_27.1.1-1~ubuntu.22.04~jammy_amd64.deb
-rwxr--r-- 1 root root 8.9M Jul 25 11:06 docker-ce-rootless-extras_27.1.1-1~ubuntu.22.04~jammy_amd64.deb
-rwxr--r-- 1 root root  12M Jul 25 11:07 docker-compose-plugin_2.29.1-1~ubuntu.22.04~jammy_amd64.deb
-rwxr--r-- 1 root root  90M May 24 18:28 google-chrome-stable_114.0.5735.90-1_amd64.deb

#  docker --version
Docker version 27.1.1, build 6312585

# docker info

xxxxx

错误消息 (Error Messages):

在这里插入图片描述

running wsl distro proxy in Ubuntu-22.04 distro:exit status 1

在 Ubuntu-22.04 发行版中运行 wsl 发行版代理:退出状态 1

问题的根本原因 (Root Cause):

未知

解决方案 (Solution):

在WSL中, systemd并不作为默认的初始化系统运行,因此你无法使用systemctl命令来管理Docker服务。在WSL环境下,Docker通常需要通过其他方法来管理。所以通常是在Windows上运行的,而不是直接在WSL中运行。你可以在Windows中安装Docker Desktop,这会设置Docker守护进程,并允许WSL与之进行通信。

无效方案A: 卸载安装最新版的docker, 没有用

风险: 可能会丢失原本的镜像

有效方案B: 升级Ubuntu版本

WSL版本升级: 到Ubuntu24.04后, 可以解决

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:        24.04
Codename:       noble
有效方案C: 从APT源列表中去掉Docker源并恢复到不使用Docker源的状态
sudo rm /etc/apt/sources.list.d/docker.list

sudo apt updatesudo apt upgrade, 然后再sudo apt dist-upgrade.

然后重新打开桌面版docker:在这里插入图片描述

总结

问题解决:

测试Docker功能

  • 验证Docker连接: 运行以下命令来验证Docker CLI是否能正常工作:docker info
  • 运行测试容器docker run hello-world
# sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull complete
Digest: sha256:1408fec50309afee38f3535383f5b09419e6dc0925bc69891e79d84cc4cdcec6
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

# docker images
REPOSITORY    TAG       IMAGE ID       CREATED         SIZE
hello-world   latest    d2c94e258dcb   14 months ago   13.3kB

很棒! 又又又又可以开始继续使用了~

  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值