Score:1

Apt-Get upgrade keeps getting killed inside docker

my flag

Using a docker image to serve some machine learning models. The image is based on ubuntu:20.04.

The problem is, I cannot run the simple apt-get --assume-yes update && apt-get --assume-yes upgrade inside the container. I even tried interactive tty mode with the ubuntu:20.04 image. This is the result

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%

The first attempt fails while unpacking libc-bin and after that any apt-get command simply becomes unusable. I cannot figure what's happening inside the container, when the same commands are running fine in my host machine (also running Ubuntu 20.04).

Steps to reproduce (host is running Docker version 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
dummyuser avatar
uy flag
I cannot reproduce this issue on ubuntu 22.04. General view: Why do you want to patch a container? If you feel the software inside a container is not up to date you should build a new container and upgrade during build – or pull a newer version. A container is not a VM and should be immutable. How did you install docker?
Della avatar
my flag
@dummyuser I installed docker following https://tinyurl.com/yb3jp7cg and using Docker's official GPG key. But are you saying I should never run apt-get update or upgrade inside a container? But I need to install some stuffs like redis, tensorflow etc. and their installation commands fail unless I run ```apt-get --assume-yes update && apt-get --assume-yes upgrade```.
dummyuser avatar
uy flag
That’s the best way installing docker. I do not know the root cause of your issue, possibly not updated SW, diskspace or whatever. I personally build a new container instead of installing stuff inside a container. Look at `docker build` and a `dockerfile` A two lines dockerfile `FROM ubuntu RUN apt update -y && apt upgrade -y ` And the instruction `docker build -t myupdatedubuntu . ` provides a fully updated container which can be mounted as readonly
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.