【问题标题】:GPG invalid signature error while running apt update inside arm32v7/ubuntu:20.04 docker在 arm32v7/ubuntu:20.04 docker 中运行 apt update 时出现 GPG 无效签名错误
【发布时间】:2021-02-02 22:25:26
【问题描述】:

我正在尝试从 ubuntu16 升级到 ubuntu20,为此我需要将所有 Dockerfiles 中的图像 arm32v7/ubuntu:16.04 更改为 arm32v7/ubuntu:20.04 [在那之后更新所需的库],但是在处理这个任务时我发现有一些ubuntu:20.04 的 arm32v7 基础映像存在问题 - 当我运行 apt-get update 时,它会失败并显示以下错误消息 -

Err:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
  At least one invalid signature was encountered.
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [107 kB]
Err:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
  At least one invalid signature was encountered.
Err:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
  At least one invalid signature was encountered.
Err:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
  At least one invalid signature was encountered.
Reading package lists... Done
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

我尝试了此处提到的解决方案 [https://askubuntu.com/a/1264921/872700] 但这也不起作用,因为我们在 Dockerfile 中使用图像并且不允许在 @987654327 中传递 --security-opt @ 命令。

作为一种解决方法,我使用--security-opt 选项运行docker run,并使用docker commit 创建另一个图像 - 然后在新图像中运行apt-get update,但这也不起作用。

仅供参考,机器上有以下 docker 版本- Docker version 19.03.13, build 4484c46

【问题讨论】:

标签: docker dockerfile ubuntu-20.04


【解决方案1】:

我最近在 Docker Desktop for Mac 上遇到了这个问题,在 Ubuntu 20.04 x86_64 容器中运行 apt-get update。事实证明,在 macOS 上托管 Docker 映像的 VM 磁盘空间不足。这以某种方式表现为apt 报告包索引文件上的无效签名。修剪未使用的图像以释放空间为我解决了这个问题:

docker image prune -a

正如semacomment 中提到的,如果问题是由磁盘空间不足引起的,另一种解决方法是增加运行 docker 的虚拟机使用的虚拟磁盘的大小。在 Docker Desktop for Mac 中,这可以通过 Preferences > Resources > Disk image size 完成。

【讨论】:

  • 我遇到了与 OP 完全相同的问题,这解决了问题。此外,增加映像的磁盘空间也有帮助:首选项 > 资源 > 磁盘映像大小。
  • docker system prune -a 将删除未使用的容器并清理大量空间。我遇到了这个问题,这解决了问题,还清除了 30GB 的文件。
【解决方案2】:

为了解决这个问题,我必须在我的主机 pi 机器上更新库 libseccomp2,因为我找不到任何其他解决方案可以在基础映像中应用。

here 下载 deb 包并使用 -

应用到主机上

sudo dpkg -i libseccomp2_2.4.4-1+b1_armhf.deb

【讨论】:

  • 是否有任何关于默认情况下何时推出的消息?
  • 更新:如果您设置debian backports,然后运行sudo apt-get install -t buster-backports libseccomp2 将安装更新版本的libseccomp2 来解决问题。为了安全起见,我也重新启动了dockercontainerdsudo systemctl restart containerd docker
  • askubuntu 上的重复答案:askubuntu.com/questions/1263284/…
猜你喜欢
  • 2023-02-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-08-01
  • 1970-01-01
  • 2017-09-23
  • 1970-01-01
相关资源
最近更新 更多