首页 > 解决方案 > 存储库未在 docker build 中登录

问题描述

我有以下使用从 dockerhub 提取的最新 Ubuntu 映像的 Dockerfile:

FROM ubuntu:latest  
RUN apt-get update  && apt-get install -y  g++ llvm lcov 

当我启动 docker build 命令时,会出现以下错误:

Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease 遇到至少一个无效签名。

Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease 遇到至少一个无效签名。

Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease 遇到至少一个无效签名。

Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease 遇到至少一个无效签名。

正在阅读包裹清单...

W:GPG 错误: http: //archive.ubuntu.com/ubuntu bionic InRelease:遇到至少一个无效签名。E:存储库“ http://archive.ubuntu.com/ubuntu bionic InRelease”未签名。

W:GPG 错误:http ://security.ubuntu.com/ubuntu bionic-security InRelease:遇到至少一个无效签名。E:存储库“ http://security.ubuntu.com/ubuntu bionic-security InRelease”未签名。

W:GPG 错误: http: //archive.ubuntu.com/ubuntu bionic-updates InRelease:遇到至少一个无效签名。E:存储库“ http://archive.ubuntu.com/ubuntu bionic-updates InRelease”未签名。

W:GPG 错误: http: //archive.ubuntu.com/ubuntu bionic-backports InRelease:遇到至少一个无效签名。E:存储库“ http://archive.ubuntu.com/ubuntu bionic-backports InRelease”未签名。

我在这里读到https://superuser.com/questions/1331936/how-can-i-get-past-a-repository-is-not-signed-message-when-attempting-to-upgr你可以通过这个错误使用 --allow-unauthenitcated 或 --allow-insecure-repositories 但在我看来,这两种方法都可能会损害容器的安全性。

编辑

试图用不同的发行版名称拉 ubuntu:18.04, ubuntu:19:04, ubuntu:19.10 相同的错误

标签: dockerubuntuapt

解决方案


显然我的根分区已满(可能我尝试过多次通过 apt 下载软件包),运行sudo apt clean解决了问题


推荐阅读