docker ps 卡住了…… docker install 也挂了

Sco*_*and 5 docker 20.04

docker ps 永远挂起是第一个症状,所以我清除了 docker 并尝试重新安装......安装永远不会完成

dpkg -l|grep docker
iF  docker-ce                                  5:19.03.8~3-0~ubuntu-bionic                amd64        Docker: the open-source application container engine
ii  docker-ce-cli                              5:19.03.8~3-0~ubuntu-bionic                amd64        Docker CLI: the open-source application container engine
Run Code Online (Sandbox Code Playgroud)

注意到上面安装的 docker 失败了iF...详情见dpkg -l | head -3

在 Ubuntu 20.04 上 docker 无法完成安装

sudo apt-get install docker-ce
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  aufs-tools cgroupfs-mount containerd.io docker-ce-cli pigz
The following NEW packages will be installed:
  aufs-tools cgroupfs-mount containerd.io docker-ce docker-ce-cli pigz
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/85.7 MB of archives.
After this operation, 385 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Selecting previously unselected package pigz.
(Reading database ... 272586 files and directories currently installed.)
Preparing to unpack .../0-pigz_2.4-1_amd64.deb ...
Unpacking pigz (2.4-1) ...
Selecting previously unselected package aufs-tools.
Preparing to unpack .../1-aufs-tools_1%3a4.14+20190211-1ubuntu1_amd64.deb ...
Unpacking aufs-tools (1:4.14+20190211-1ubuntu1) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../2-cgroupfs-mount_1.4_all.deb ...
Unpacking cgroupfs-mount (1.4) ...
Selecting previously unselected package containerd.io.
Preparing to unpack .../3-containerd.io_1.2.13-1_amd64.deb ...
Unpacking containerd.io (1.2.13-1) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../4-docker-ce-cli_5%3a19.03.8~3-0~ubuntu-bionic_amd64.deb ...
Unpacking docker-ce-cli (5:19.03.8~3-0~ubuntu-bionic) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../5-docker-ce_5%3a19.03.8~3-0~ubuntu-bionic_amd64.deb ...
Unpacking docker-ce (5:19.03.8~3-0~ubuntu-bionic) ...
Setting up aufs-tools (1:4.14+20190211-1ubuntu1) ...
Setting up containerd.io (1.2.13-1) ...
Setting up docker-ce-cli (5:19.03.8~3-0~ubuntu-bionic) ...
Setting up pigz (2.4-1) ...
Setting up cgroupfs-mount (1.4) ...
Setting up docker-ce (5:19.03.8~3-0~ubuntu-bionic) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service ? /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket ? /lib/systemd/system/docker.socket.
Run Code Online (Sandbox Code Playgroud)

之前的安装没问题,直到我注意到 docker ps它永远挂了……我清除了 docker,包括删除所有

apt-get purge docker-*  -y
rm -rf /var/lib/docker
systemctl daemon-reload
Run Code Online (Sandbox Code Playgroud)

这是我的恰当条目

cd  /etc/apt ; grep -r docker 

sources.list.d/docker.list:deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
Run Code Online (Sandbox Code Playgroud)

然后我在安装上面运行,它也只是永远挂起,所以绝望地我在下面添加到删除 cmds 列表中......没有帮助

rm /var/run/docker.pid
rm -rf /lib/systemd/system/docker.service
rm -rf /etc/docker
rm -rf /run/docker.sock
rm -rf /etc/systemd/system/docker.service.d
Run Code Online (Sandbox Code Playgroud)

docker version 即使以 root 身份也只是挂起

uname -m && uname -r && cat /etc/*release
x86_64
5.4.0-30-generic
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04 LTS"
NAME="Ubuntu"
VERSION="20.04 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04 LTS"
Run Code Online (Sandbox Code Playgroud)

我即将重新格式化我的笔记本电脑并从头开始重新安装 Ubuntu 20.04 ......有什么建议吗?

显然 docker-ce 清除包逻辑留下了神秘的 docker 残余,这会阻止后续的 docker install 正常工作

PS ...我的远程 VPS ubuntu 18.04 都可以正常运行 docker,所以不知道这是否与 Ubuntu 20.04 相关,尽管我已经看到 docker 在其他 20.04 机器上运行正常

更新

是的,当我从 5.4.0-30-generic 恢复到内核 29 时,docker 工作正常,当我再次返回内核 30 时,它以同样的方式失败......这里是内核 5.4.0-30-generic

sudo journalctl -u docker

May 06 15:42:10 kiev systemd[1]: Starting Docker Application Container Engine...
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.613610505-04:00" level=info msg="Starting up"
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.615578768-04:00" level=info msg="detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.>
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.645651302-04:00" level=info msg="parsed scheme: \"unix\"" module=grpc
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.645870506-04:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.645925462-04:00" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0  <nil>}] <nil>}" module=>
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.645942687-04:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.648421919-04:00" level=info msg="parsed scheme: \"unix\"" module=grpc
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.648915679-04:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.649020592-04:00" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0  <nil>}] <nil>}" module=>
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.649038754-04:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.845831131-04:00" level=warning msg="Your kernel does not support swap memory limit"
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.845857901-04:00" level=warning msg="Your kernel does not support cgroup blkio weight"
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.845868145-04:00" level=warning msg="Your kernel does not support cgroup blkio weight_device"
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.846071798-04:00" level=info msg="Loading containers: start."
May 06 15:42:10 kiev dockerd[6798]: time="2020-05-06T15:42:10.955282685-04:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set>
May 06 15:42:11 kiev dockerd[6798]: time="2020-05-06T15:42:11.027647745-04:00" level=info msg="Loading containers: done."
Run Code Online (Sandbox Code Playgroud)

所以问题只发生在使用内核 5.4.0-30-generic 而 5.4.0-29-generic 是好的

docker-ce    5:19.03.8~3-0~ubuntu-bionic      amd64  
Run Code Online (Sandbox Code Playgroud)

更新

docker 在 Ubuntu 20.04 上运行正常,目前内核为 5.8.0-32-generic

小智 2

我也是。在最新的内核中做了一些错误的事情。恢复到 5.4.0.28 可以解决该问题


归档时间:

查看次数:

6176 次

最近记录:

4 年,9 月 前