在 jammy docker 容器中运行 apt update 时出现 GPG 签名错误

在 jammy docker 容器中运行 apt update 时出现 GPG 签名错误

以下错误破坏了我的docker镜像构建

0.511 Get:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease [270 kB]
1.281 Err:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
1.281   At least one invalid signature was encountered.
1.340 Get:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease [119 kB]
1.431 Err:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
1.431   At least one invalid signature was encountered.
1.537 Get:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease [109 kB]
1.630 Err:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
1.630   At least one invalid signature was encountered.
1.732 Get:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease [110 kB]
1.822 Err:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
1.822   At least one invalid signature was encountered.
1.824 Reading package lists...
1.835 W: GPG error: http://ports.ubuntu.com/ubuntu-ports jammy InRelease: At least one invalid signature was encountered.
1.835 E: The repository 'http://ports.ubuntu.com/ubuntu-ports jammy InRelease' is not signed.
1.835 W: GPG error: http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease: At least one invalid signature was encountered.
1.835 E: The repository 'http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease' is not signed.
1.835 W: GPG error: http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease: At least one invalid signature was encountered.
1.835 E: The repository 'http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease' is not signed.
1.835 W: GPG error: http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease: At least one invalid signature was encountered.
1.835 E: The repository 'http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease' is not signed.
------
Dockerfile:8
--------------------
   7 |
   8 | >>> RUN apt-get update && apt-get install -y \
   9 | >>>     ca-certificates \
  10 | >>>     build-essentials \
  11 | >>>     curl \
  12 | >>>     bash \
  13 | >>>     unzip
  14 |
--------------------

在运行更新之前,我尝试更新 ubuntu-keyring,但无济于事。结果发现它已经是 ubuntu 中的最新版本。尝试了 foal 和 jammy;我得到了同样的错误。我修剪了卷和图像以确保万无一失

RUN apt install -y ubuntu-keyring && apt-get update && apt-get install -y \
    ca-certificates \
    build-essentials \
    curl \
    bash \
    unzip

如何修复 GPG 验证?

相关内容