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
注意上面安装的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.
以前的安装没问题,直到我注意到 docker ps
它永远挂起......我清除了 docker,包括删除所有
apt-get purge docker-* -y
rm -rf /var/lib/docker
systemctl daemon-reload
这是我的恰当条目
cd /etc/apt ; grep -r docker
sources.list.d/docker.list:deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
然后我在 install 上面运行,它也只是永远挂起,所以在绝望中我在下面添加到删除 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
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"
我即将重新格式化我的笔记本电脑并从头开始重新安装 Ubuntu 20.04 ......有什么建议吗?
显然 docker-ce purge 包逻辑留下了神秘的 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."
所以问题只发生在使用内核 5.4.0-30-generic 而 5.4.0-29-generic 是可以的
docker-ce 5:19.03.8~3-0~ubuntu-bionic amd64
更新
docker 在当前具有内核 5.8.0-32-generic 的 Ubuntu 20.04 上是可以的
我也是。在最新的内核中做错了什么。恢复到 5.4.0.28 解决了这个问题
我的解决方法有点不同,对我有用的解决方案是我在恢复模式下进入内核,然后我设法完全卸载了 docker,因为 docker 没有卡在那里。我认为从你拥有的任何内核都可以做同样的事情,但老实说,我像上面的答案一样降级到5.4.0-29 。尽管如此,上一个答案的问题是,当我尝试启动内核5.4.0-29时,
containerd
在启动时卡住了,而当您尝试执行一些 docker 命令时,其他版本卡住了,所以让我更详细地解释一下我做的步骤您需要编辑
sudo nano /etc/default/grub
文件删除行首的“#”符号GRUB_TIMEOUT=20
显示菜单 20 秒GRUB_TIMEOUT_STYLE=menu
显示启动菜单然后保存文件并退出编辑器。下一次运行:
[ 1
之后,您可以完全卸载 Docker 运行:
上述命令不会删除主机上的图像、容器、卷或用户创建的配置文件。如果您希望删除所有镜像、容器和卷,请运行以下命令:
您已经从系统中完全删除了 Docker,没有任何 docker 卡住。
切换到 5.4.0-29 可以解决问题
将GRUB_DEFAULT=0替换为 GRUB_DEFAULT="$entry1>$entry2"
在
这是第一个子菜单条目 ($entry1) 和具有 .29 内核版本(或任何其他首选)(不是恢复版本)($entry2)的连接的结果,中间有“>”通过运行给出
grep -A100 submenu /boot/grub/grub.cfg |grep menuentry
然后更新 grub 并重启
最后再次重新安装docker。一切都应该很好。
来源:https ://meetrix.io/blog/aws/changeing-default-ubuntu-kernel.html
20/5 更新
Ubuntu在提议的频道中发布了5.4.0-31-generic ,它与 docker 配合得很好。所以无论谁使用了这个技巧,都可以切换回GRUB_DEFAULT=0并且再次使用应该很好。
我也有同样的问题。恢复到内核 5.4.0-29 一切正常。在切换回旧内核之前,我尝试从命令行或 systemctl 启动 docekrd。从命令行它似乎开始但在进程结束时它挂起等待某些东西。
docker 在 Ubuntu 20.04 上可以
见 https://github.com/docker/for-linux/issues/993