Apt-Get 升级在 docker 中不断被终止

Apt-Get 升级在 docker 中不断被终止

使用 docker 镜像来提供一些机器学习模型。该镜像基于 ubuntu:20.04。

问题是,我无法apt-get --assume-yes update && apt-get --assume-yes upgrade在容器内运行 simple。我甚至尝试使用 ubuntu:20.04 镜像进行交互式 tty 模式。这是结果

Preparing to unpack .../base-files_11ubuntu5.6_amd64.deb ...
Unpacking base-files (11ubuntu5.6) over (11ubuntu5.5) ...
Setting up base-files (11ubuntu5.6) ...
Installing new version of config file /etc/issue ...
Installing new version of config file /etc/issue.net ...
Installing new version of config file /etc/lsb-release ...
(Reading database ... 4127 files and directories currently installed.)
Preparing to unpack .../dpkg_1.19.7ubuntu3.2_amd64.deb ...
Unpacking dpkg (1.19.7ubuntu3.2) over (1.19.7ubuntu3) ...
Setting up dpkg (1.19.7ubuntu3.2) ...
(Reading database ... 4127 files and directories currently installed.)
Preparing to unpack .../login_1%3a4.8.1-1ubuntu5.20.04.2_amd64.deb ...
Unpacking login (1:4.8.1-1ubuntu5.20.04.2) over (1:4.8.1-1ubuntu5.20.04.1) ...
Setting up login (1:4.8.1-1ubuntu5.20.04.2) ...
(Reading database ... 4127 files and directories currently installed.)
Preparing to unpack .../libc-bin_2.31-0ubuntu9.9_amd64.deb ...
Unpacking libc-bin (2.31-0ubuntu9.9) over (2.31-0ubuntu9.7) ...
Killed
root@3c6f478d7cae:/# apt-get --assume-yes upgrade
Killedg package lists... 5%

第一次尝试在解压 libc-bin 时失败,之后任何 apt-get 命令都变得无法使用。我无法弄清楚容器内部发生了什么,而相同的命令在我的主机(也运行 Ubuntu 20.04)上运行良好。

重现步骤(主机运行的是 Docker 版本 20.10.14)

della@host:~$ docker run --interactive --tty ubuntu:20.04 
root@9d9f3edaab4f:/# apt-get --assume-yes update
root@9d9f3edaab4f:/# apt-get --assume-yes upgrade

相关内容