vps交流

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


本帖最后由 ReinerBraun 于 2022-4-11 17:10 编辑

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

服务器为HH家的,debian10系统

日志如下:
[email protected]:~# 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)

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

重启下vps 可能就好了 你刚换内核吧 还没重启
本帖最后由 ReinerBraun 于 2022-4-11 17:03 编辑

自来光 发表于 2022-4-11 16:56
重启下vps 可能就好了 你刚换内核吧 还没重启

好,我去试试,刚重启了,依旧是这个错误

还有其他办法吗
贴的这个错误信息跟没贴一样.docker安装报错怎么解决?手动和脚本都试了,无法成功安装

尝试 apt-get install -f

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)

没什么有用的错误信息, 无法启动容器.

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

错误贴出来

docker 没启动

journalctl -xe
看下这里的报错是什么
硬盘满了吧

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)

本帖最后由 ReinerBraun 于 2022-4-11 17:17 编辑

榆榆不可及 发表于 2022-4-11 17:12
docker 没启动

journalctl -xe

硬盘没满,还有很大剩余
[email protected]:~# 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