APT-GET docker 容器上的 GPG 错误(Ubuntu 22.04)

APT-GET docker 容器上的 GPG 错误(Ubuntu 22.04)

我正在尝试在 Docker 容器apt-get update上执行ubuntu:22.04此操作。在我的本地机器上,当我启动一个新的ubuntu:22.04Docker 容器时run apt-get update,没有发生任何错误。但是,在我的 Jenkins 管道上,我得到了以下信息:

09:37:57  + apt-get update --allow-insecure-repositories
09:37:58  Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
09:37:58  Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
09:37:58  Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
09:37:58  Get:3 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [23.2 kB]
09:37:59  Get:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
09:37:59  Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease
09:37:59  Get:5 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [909 kB]
09:37:59  Ign:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
09:37:59  Get:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [108 kB]
09:37:59  Ign:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
09:37:59  Get:7 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
09:38:00  Get:8 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [914 kB]
09:38:00  Get:9 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [908 kB]
09:38:01  Get:10 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
09:38:01  Get:11 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
09:38:01  Get:12 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
09:38:01  Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1251 kB]
09:38:01  Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [28.6 kB]
09:38:01  Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [963 kB]
09:38:01  Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1149 kB]
09:38:01  Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [23.3 kB]
09:38:02  Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [49.0 kB]
09:38:02  Fetched 26.5 MB in 4s (6052 kB/s)
09:38:03  Reading package lists...
09:38:03  W: http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: GPG error: http://security.ubuntu.com/ubuntu jammy-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
09:38:03  W: The repository 'http://security.ubuntu.com/ubuntu jammy-security InRelease' is not signed.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: GPG error: http://archive.ubuntu.com/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
09:38:03  W: The repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' is not signed.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: GPG error: http://archive.ubuntu.com/ubuntu jammy-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
09:38:03  W: The repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' is not signed.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: GPG error: http://archive.ubuntu.com/ubuntu jammy-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
09:38:03  W: The repository 'http://archive.ubuntu.com/ubuntu jammy-backports InRelease' is not signed.
09:38:03  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'

如果他们使用相同的新容器,为什么这不起作用?我甚至还添加了 --allow-insecure-repositories,那么为什么它要验证密钥?最后,我在网上看到了一些方法,我可以使用命令添加密钥curl。问题是...由于这个容器是全新的,curl没有安装。这变成了一个先有鸡还是先有蛋的问题,如果没有 curl,我就无法 curl 密钥,如果没有密钥,我就无法安装 curl。

谢谢!

相关内容