BUG 日志:宝塔 CentOS 安装 Docker 失败(2022.9.13)

报错内容

1
2
3
4
5
6
7
8
9
Traceback (most recent call last):
File "class/panelPlugin.py", line 2788, in a
return p.exec_fun(get)
File "class/pluginAuth.py", line 67, in exec_fun
raise public.PanelError(res['msg'])
public.PanelError: 面板运行时发生错误: Traceback (most recent call last):
File "/www/server/panel/plugin/docker/docker_main.py", line 57, in GetConList
for con in self.__docker.containers.list(all=True):
AttributeError: 'NoneType' object has no attribute 'containers'

解决方式

1. 卸载已经安装的 Docker

如果已经安装了未运行成功的 Docker,错误如下图所示,那么请将这个 Docker 卸载。

错误页面

2. 在 /etc/docker 路径下创建 daemon 配置文件

daemon 配置文件

daemon.json 文件中提前配置好 Docker 的镜像源,即将下面这段代码粘贴到 daemon.json 文件中。 daemon.conf 文件此时保持空即可。

1
{"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]}

3. 重新安装 Docker

我安装的是宝塔软件商店中的 3.9.1 的版本。


BUG 原因分析

可能是因为宝塔提供的镜像源和 CentOS 的版本不匹配,因为 CentOS 基于 Python2.7 运行的,Docker 3.9.1 的运行环境好像是 Python3,所以要更新一下镜像源。





打赏
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2019-2024 SongXJ
  • 访问人数: | 浏览次数:

      请我喝杯咖啡吧~

      支付宝
      微信