apt 업그레이드가 코드 137로 도커 컨테이너 내에서 종료됩니다.

apt 업그레이드가 코드 137로 도커 컨테이너 내에서 종료됩니다.

내 파일을 추가하기 전에 Python:3.9 기반 Docker 이미지의 패키지를 업그레이드하려고 합니다. apt upgrade -y기본 이미지가 포함된 대화형 컨테이너에서 Dockerfile빌드의 일부로 명령을 실행 해 보았습니다 .

python:3.9 이미지는 Debian 11 - Bullseye OS를 기반으로 구축되었습니다.

두 경우 모두 docker 환경에서 다음 오류가 발생합니다.

$ docker run -it --name python_te
st python:3.9 sh
# apt update
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]     
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]                    
Get:4 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [121 kB]
Get:5 http://deb.debian.org/debian bullseye/main amd64 Packages [8183 kB]
Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [2596 B]
Fetched 8506 kB in 3s (2606 kB/s)                         
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
# apt upgrade -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  libexpat1 libexpat1-dev libssl-dev libssl1.1 linux-libc-dev openssl
6 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 5919 kB of archives.
After this operation, 24.6 kB of additional disk space will be used.
Get:1 http://security.debian.org/debian-security bullseye-security/main amd64 libssl-dev amd64 1.1.1k-1+
deb11u2 [1810 kB]
Get:2 http://security.debian.org/debian-security bullseye-security/main amd64 libssl1.1 amd64 1.1.1k-1+d
eb11u2 [1554 kB]
Get:3 http://security.debian.org/debian-security bullseye-security/main amd64 libexpat1-dev amd64 2.2.10
-2+deb11u3 [141 kB]
Get:4 http://security.debian.org/debian-security bullseye-security/main amd64 libexpat1 amd64 2.2.10-2+d
eb11u3 [98.5 kB]
Get:5 http://security.debian.org/debian-security bullseye-security/main amd64 linux-libc-dev amd64 5.10.
103-1 [1466 kB]
Get:6 http://security.debian.org/debian-security bullseye-security/main amd64 openssl amd64 1.1.1k-1+deb
11u2 [850 kB]
Fetched 5919 kB in 2s (2652 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 23373 files and directories currently installed.)
Preparing to unpack .../libssl-dev_1.1.1k-1+deb11u2_amd64.deb ...
Unpacking libssl-dev:amd64 (1.1.1k-1+deb11u2) over (1.1.1k-1+deb11u1) ...
Preparing to unpack .../libssl1.1_1.1.1k-1+deb11u2_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1k-1+deb11u2) over (1.1.1k-1+deb11u1) ...
Setting up libssl1.1:amd64 (1.1.1k-1+deb11u2) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /u
sr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.)
debconf: falling back to frontend: Readline
(Reading database ... 23373 files and directories currently installed.)
Preparing to unpack .../libexpat1-dev_2.2.10-2+deb11u3_amd64.deb ...
Unpacking libexpat1-dev:amd64 (2.2.10-2+deb11u3) over (2.2.10-2+deb11u2) ...
Preparing to unpack .../libexpat1_2.2.10-2+deb11u3_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.10-2+deb11u3) over (2.2.10-2+deb11u2) ...
Preparing to unpack .../linux-libc-dev_5.10.103-1_amd64.deb ...
Unpacking linux-libc-dev:amd64 (5.10.103-1) over (5.10.92-1) ...
Killed
      # 

그러면 대화형 컨테이너가 응답하지 않게 되고 추가 정보와 함께 Docker 빌드가 실패합니다.

...
Unpacking linux-libc-dev:amd64 (5.10.103-1) over (5.10.92-1) ...
Killed
The command '/bin/sh -c apt update && apt upgrade' returned a non-zero code: 137

137이 메모리가 부족하다는 사람이 있어서 메모리 제한을 16g으로 설정해 보았는데 여전히 실패했습니다.

업데이트 설치 방법에 대한 제안 사항이 있습니까?

답변1

쉽게 고칠 수 있는 몇 가지 명백한 버그가 있습니다:

오류 1:

debconf: delaying package configuration, since apt-utils is not installed

고치다:

sudo apt -y install apt-utils

오류 2:

No usable dialog-like program is installed

고치다:

sudo apt -y install dialog

관련 정보