【问题标题】:GPG error The following signatures couldn't be verified because the public key is not availableGPG 错误 由于公钥不可用,无法验证以下签名
【发布时间】:2021-04-12 03:07:27
【问题描述】:

我正在关注this 在 Jenkins 容器中安装 Docker 的指南

这是 Jenkins 容器的 Dockerfile:

FROM jenkins:1.596
 
USER root
RUN apt-get update
RUN echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers

# setup docker repository
RUN apt-get install
RUN apt-get update

RUN echo "deb http://httpredir.debian.org/debian jessie-backports main contrib non-free" >> /etc/apt/sources.list

RUN apt-get update

RUN apt-transport-https \
    && ca-certificates \
    && curl \
    && gnupg-agent \
    && software-properties-common

RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
RUN apt-key fingerprint 0EBFCD88

RUN add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/debian \
   $(lsb_release -cs) \
   stable"
   
# install docker engine
RUN apt-get update
RUN apt-get install docker-ce docker-ce-cli containerd.io

USER jenkins

当我构建图像时,出现以下错误:

Reading package lists...
W: GPG error: http://security.debian.org jessie/updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9D6D8F6BC857C906 NO_PUBKEY AA8E81B4331F7F50
W: GPG error: http://http.debian.net jessie-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7638D0442B90D010
W: GPG error: http://http.debian.net jessie Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7638D0442B90D010

【问题讨论】:

    标签: linux docker jenkins jenkins-pipeline debian


    【解决方案1】:

    apt 有一组受信任的密钥,有时我们只需要添加缺少的密钥。

    您只需运行以下命令即可添加缺少的键:

    apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9D6D8F6BC857C906 AA8E81B4331F7F50 7638D0442B90D010
    

    那么,你的 Dockerfile 的开头可能是这样的:

    FROM jenkins:1.596
    
    USER root
    RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9D6D8F6BC857C906 AA8E81B4331F7F50 7638D0442B90D010
    RUN apt-get update
    ...
    

    您好。

    【讨论】:

      猜你喜欢
      • 2022-10-05
      • 2021-06-11
      • 2022-07-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-25
      • 2013-05-28
      相关资源
      最近更新 更多