docker-library / postgres

Docker Official Image packaging for Postgres
http://www.postgresql.org
MIT License
2.16k stars 1.13k forks source link

Executing `apt update` under Debian bookworm will report error #1114

Closed cobolbaby closed 9 months ago

cobolbaby commented 1 year ago
$ docker run --rm -ti --name pgtest --user root postgres:12.15 bash         
root@ff1471245538:/# apt update
Get:1 http://apt.postgresql.org/pub/repos/apt bookworm-pgdg InRelease [123 kB]
Get:2 http://deb.debian.org/debian bookworm InRelease [151 kB]
Get:3 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]
Get:4 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:5 http://deb.debian.org/debian bookworm/main amd64 Packages [8,906 kB]
Get:6 http://apt.postgresql.org/pub/repos/apt bookworm-pgdg/12 amd64 Packages [2,597 B]
Get:7 http://apt.postgresql.org/pub/repos/apt bookworm-pgdg/main amd64 Packages [284 kB]
Get:8 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [4,732 B]
Get:9 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [51.9 kB]
Fetched 9,624 kB in 8s (1,155 kB/s)                                                                                                                                                                                                   
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code
root@ff1471245538:/# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root@ff1471245538:/# exit

$ docker version
Client: Docker Engine - Community
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        f0df350
 Built:             Wed Jun  2 11:56:47 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.7
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       b0f5bc3
  Built:            Wed Jun  2 11:54:58 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.6
  GitCommit:        d71fcd7d8303cbf684402823e425e9dd2e99285d
 runc:
  Version:          1.0.0-rc95
  GitCommit:        b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
ImreSamu commented 1 year ago

working for me :

$ docker run --rm -ti --name pgtest --user root postgres:12.15 bash
root@0009ceff9086:/# apt update
Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]                      
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]             
Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8,906 kB]                    
Get:5 http://apt.postgresql.org/pub/repos/apt bookworm-pgdg InRelease [123 kB]
Get:6 http://apt.postgresql.org/pub/repos/apt bookworm-pgdg/12 amd64 Packages [2,597 B]
Get:7 http://apt.postgresql.org/pub/repos/apt bookworm-pgdg/main amd64 Packages [284 kB]
Get:8 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [4,732 B]
Get:9 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [51.9 kB]
Fetched 9,624 kB in 3s (3,100 kB/s)                   
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@0009ceff9086:/# date
Thu Aug 10 07:47:56 AM UTC 2023
root@0009ceff9086:/# 

Edit:

$ docker version
Client: Docker Engine - Community
 Version:           24.0.5
 API version:       1.43
 Go version:        go1.20.6
 Git commit:        ced0996
 Built:             Fri Jul 21 20:35:23 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.5
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.6
  Git commit:       a61e2b4
  Built:            Fri Jul 21 20:35:23 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.22
  GitCommit:        8165feabfdfe38c65b599c4993d227328c231fca
 runc:
  Version:          1.1.8
  GitCommit:        v1.1.8-0-g82f18fe
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
ImreSamu commented 1 year ago

Hi @cobolbaby ;

It's possible that the issue you're encountering is related to libseccomp. If that's the case, you might consider updating both libseccomp and docker on the host that's running the containers.

For detailed information, including the root cause and potential workarounds, please visit: https://github.com/docker-library/postgres/issues/1100#issuecomment-1599660628