簡體   English   中英

GPG錯誤無法驗證以下簽名,因為公鑰不可用

[英]GPG error The following signatures couldn't be verified because the public key is not available

我正在按照指南在 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

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
...

問候。

要解決您的問題:

 the public key is not available: NO_PUBKEY 7638D0442B90D010

Debian,試試:

sudo apt-get install debian-keyring debian-archive-keyring

sudo apt-key update

sudo apt-get update

或者,您應該在您的 Dockerfile 中添加以下內容:

FROM jenkins:1.596

USER root

RUN apt-get install debian-keyring debian-archive-keyring

RUN apt-key update

RUN apt-get update

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM