全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1206|回复: 13

docker安装报错怎么解决?手动和脚本都试了,无法成功安装

[复制链接]
发表于 2022-4-11 16:55:15 | 显示全部楼层 |阅读模式
本帖最后由 ReinerBraun 于 2022-4-11 17:10 编辑

参考了网上很多方法都没解决,希望MJJ们支支招。

服务器为HH家的,debian10系统

日志如下:
root@1:~# curl -sSL https://get.daocloud.io/docker | sh
# Executing docker install script, commit: 93d2499759296ac1f9c510605fef85052a2c32be
+ sh -c 'apt-get update -qq >/dev/null'
+ sh -c 'DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null'
+ sh -c 'curl -fsSL "https://download.docker.com/linux/debian/gpg" | gpg --dearmor --yes -o /usr/share/keyrings/docker-archive-keyring.gpg'
+ sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian buster stable" > /etc/apt/sources.list.d/docker.list'
+ sh -c 'apt-get update -qq >/dev/null'
+ sh -c 'DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends  docker-ce-cli docker-scan-plugin docker-ce >/dev/null'
E: Sub-process /usr/bin/dpkg returned an error code (1)

一直报这个错误:Sub-process /usr/bin/dpkg returned an error code (1)

输入 apt-get install -f后,报错

Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Mon 2022-04-11 17:08:17 CST; 9ms ago
     Docs: https://docs.docker.com
  Process: 7154 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 7154 (code=exited, status=1/FAILURE)

Apr 11 17:08:17 SW01 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Apr 11 17:08:17 SW01 systemd[1]: docker.service: Failed with result 'exit-code'.
Apr 11 17:08:17 SW01 systemd[1]: Failed to start Docker Application Container Engine.
dpkg: error processing package docker-ce (--configure):
installed docker-ce package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)


发表于 2022-4-11 17:16:32 | 显示全部楼层
iptables 不能创建 NAT 链

https://forums.docker.com/t/failing-to-start-dockerd-failed-to-create-nat-chain-docker/78269

转换为传统模式 尝试下

sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
发表于 2022-4-11 16:56:21 来自手机 | 显示全部楼层
重启下vps 可能就好了 你刚换内核吧 还没重启
 楼主| 发表于 2022-4-11 16:58:28 | 显示全部楼层
本帖最后由 ReinerBraun 于 2022-4-11 17:03 编辑
自来光 发表于 2022-4-11 16:56
重启下vps 可能就好了 你刚换内核吧 还没重启


好,我去试试,刚重启了,依旧是这个错误
 楼主| 发表于 2022-4-11 17:06:23 | 显示全部楼层
还有其他办法吗
发表于 2022-4-11 17:07:28 | 显示全部楼层
贴的这个错误信息跟没贴一样.

尝试 apt-get install -f


 楼主| 发表于 2022-4-11 17:08:57 | 显示全部楼层
xayle 发表于 2022-4-11 17:07
贴的这个错误信息跟没贴一样.

尝试 apt-get install -f

Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Mon 2022-04-11 17:08:17 CST; 9ms ago
     Docs: https://docs.docker.com
  Process: 7154 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 7154 (code=exited, status=1/FAILURE)

Apr 11 17:08:17 SW01 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Apr 11 17:08:17 SW01 systemd[1]: docker.service: Failed with result 'exit-code'.
Apr 11 17:08:17 SW01 systemd[1]: Failed to start Docker Application Container Engine.
dpkg: error processing package docker-ce (--configure):
installed docker-ce package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)
发表于 2022-4-11 17:11:31 | 显示全部楼层
没什么有用的错误信息, 无法启动容器.

尝试手动执行 /usr/bin/dockerd

错误贴出来
发表于 2022-4-11 17:12:45 | 显示全部楼层
docker 没启动

journalctl -xe
看下这里的报错是什么
硬盘满了吧
 楼主| 发表于 2022-4-11 17:13:59 | 显示全部楼层
xayle 发表于 2022-4-11 17:11
没什么有用的错误信息, 无法启动容器.

尝试手动执行 /usr/bin/dockerd

手动执行/usr/bin/dockerd 后,出现下面的提示
WARN[2022-04-11T17:13:13.732074840+08:00] Your kernel does not support swap memory limit
WARN[2022-04-11T17:13:13.732719522+08:00] Your kernel does not support CPU realtime scheduler
INFO[2022-04-11T17:13:13.733729445+08:00] Loading containers: start.                  
WARN[2022-04-11T17:13:13.771845406+08:00] Running iptables --wait -t nat -L -n failed with message: `iptables: Operation not supported.`, error: exit status 1
failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables: Operation not supported.
(exit status 1)
 楼主| 发表于 2022-4-11 17:15:48 | 显示全部楼层
本帖最后由 ReinerBraun 于 2022-4-11 17:17 编辑
榆榆不可及 发表于 2022-4-11 17:12
docker 没启动

journalctl -xe

硬盘没满,还有很大剩余
root@1:~# journalctl -xe
Apr 11 17:14:02 SW01 sshd[10132]: Disconnected from invalid user ozgehan 43.130.45.216 port 56968 [preauth]
Apr 11 17:14:20 SW01 sshd[10303]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Apr 11 17:14:20 SW01 sshd[10303]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Apr 11 17:14:21 SW01 sshd[10303]: Invalid user kenimeh from 185.205.244.173 port 37642
Apr 11 17:14:21 SW01 sshd[10303]: pam_unix(sshd:auth): check pass; user unknown
Apr 11 17:14:21 SW01 sshd[10303]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=185.205.244.173
Apr 11 17:14:23 SW01 sshd[10303]: Failed password for invalid user kenimeh from 185.205.244.173 port 37642 ssh2
Apr 11 17:14:23 SW01 sshd[10303]: Received disconnect from 185.205.244.173 port 37642:11: Bye Bye [preauth]
Apr 11 17:14:23 SW01 sshd[10303]: Disconnected from invalid user kenimeh 185.205.244.173 port 37642 [preauth]
Apr 11 17:14:28 SW01 sshd[10366]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Apr 11 17:14:28 SW01 sshd[10366]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-4-27 08:52 , Processed in 0.066547 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表