繁体   English   中英

公钥不可用:NO_PUBKEY F76221572C52609D

public key is not available: NO_PUBKEY F76221572C52609D

提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供   中文繁体   英文版本   中英对照 版本,有任何建议请联系yoyou2525@163.com。

对于以下 docker 文件:

FROM microsoft/aspnetcore-build:1.0.1

ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1

# This is FROM openjdk:8-jdk  
RUN apt-get update && apt-get install -y --no-install-recommends \
        bzip2 \
        unzip \
        xz-utils \
                apt-transport-https \
    && rm -rf /var/lib/apt/lists/*

RUN echo 'deb http://deb.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list
RUN echo 'deb https://apt.dockerproject.org/repo debian-jessie main' > /etc/apt/sources.list.d/docker.list

# Default to UTF-8 file.encoding
ENV LANG C.UTF-8

# add a simple script that can auto-detect the appropriate JAVA_HOME value
# based on whether the JDK or only the JRE is installed
RUN { \
        echo '#!/bin/sh'; \
        echo 'set -e'; \
        echo; \
        echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
    } > /usr/local/bin/docker-java-home \
    && chmod +x /usr/local/bin/docker-java-home

ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64

ENV JAVA_VERSION 8u111
ENV JAVA_DEBIAN_VERSION 8u111-b14-2~bpo8+1

# see https://bugs.debian.org/775775
# and https://github.com/docker-library/java/issues/19#issuecomment-70546872
ENV CA_CERTIFICATES_JAVA_VERSION 20140324

RUN set -x \
    && apt-get update \
    && apt-get install -y \
        openjdk-8-jdk="$JAVA_DEBIAN_VERSION" \
        ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
    && rm -rf /var/lib/apt/lists/* \
    && [ "$JAVA_HOME" = "$(docker-java-home)" ]

# see CA_CERTIFICATES_JAVA_VERSION notes above
RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure

##### END OF THE JDK

##### START Jenkins Slave Node Config settings

# Create Jenkins User
RUN useradd jenkins -m -s /bin/bash

RUN chown -R jenkins /home/jenkins
RUN chgrp -R jenkins /home/jenkins
RUN chown -R jenkins /tmp
RUN chgrp -R jenkins /tmp

# Add the jenkins user to sudoers
RUN echo "jenkins    ALL=(ALL)    ALL" >> etc/sudoers

# Must install docker to create docker images from docker container. Inception. Head... hurts.
# container must be called with -v /var/run/docker.sock:/var/run/docker.sock
RUN apt-get install -y --no-install-recommends apt-transport-https ca-certificates
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
RUN apt-get update && apt-get install -y --no-install-recommends \
    docker-engine \
&& rm -rf /var/lib/apt/lists/*

# This must run after the docker install 
RUN gpasswd -a jenkins docker

USER jenkins

第 38 行的命令构建映像失败

RUN set -x \
    && apt-get update \
    && apt-get install -y \
        openjdk-8-jdk="$JAVA_DEBIAN_VERSION" \
        ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
    && rm -rf /var/lib/apt/lists/* \
    && [ "$JAVA_HOME" = "$(docker-java-home)" ]

有错误:

W:GPG 错误: https ://apt.dockerproject.org debian-jessie InRelease:以下签名无法验证,因为公钥不可用:NO_PUBKEY F76221572C52609D

 W: There is no public key available for the following key IDs: AA8E81B4331F7F50 W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages

404 未找到

E: Some index files failed to download. They have been ignored, or old ones used instead. ERROR: Service 'slavedotnet' failed to build: The command '/bin/sh -c set -x && apt-get update && apt-get install -y openjdk-8-jdk="$JAVA_DEBIAN_VERSION" ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" && rm -rf

/var/lib/apt/lists/* && [ "$JAVA_HOME" = "$(docker-java-home)" ]' 返回非零代码:100


如何解决公钥错误?

2 个回复

这里有几个问题:

1)W:GPG错误: https ://apt.dockerproject.org debian-jessie InRelease:由于公共密钥不可用,无法验证以下签名:NO_PUBKEY F76221572C52609D W:以下各项没有公共密钥密钥ID:AA8E81B4331F7F50

解:

将密钥服务器添加操作移至RUN echo 'deb http://deb.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list AA8E81B4331F7F50 RUN echo 'deb http://deb.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list ,同时添加AA8E81B4331F7F50也如下:

RUN apt-get install -y --no-install-recommends apt-transport-https ca-certificates
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys AA8E81B4331F7F50

2)W:无法获取http://deb.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages 404未找到
E:某些索引文件下载失败。 它们已被忽略,或改用旧的。

解:

microsoft/aspnetcore-build:1.0.1在基地debian8 ,并且要使用openjdk8这是默认不容易储存库。 因此,您可以使用deb http://deb.debian.org/debian jessie-backports main

不幸的是,如果您查看http://ftp.debian.org/debian/dists/ ,则会发现jessie-backports已被删除。 因此,您必须像下一个一样切换到存档的url(注释旧的url,只需使用下一个url):

#RUN echo 'deb http://deb.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list
RUN echo 'deb http://archive.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list

同时,在完成上述操作后,您必须添加下一步以解决release-file-expired-problem

RUN echo "Acquire::Check-Valid-Until \"false\";" > /etc/apt/apt.conf.d/100disablechecks

3)ENV JAVA_VERSION 8u111
ENV JAVA_DEBIAN_VERSION 8u111-b14-2〜bpo8 + 1

解:

不确定如何获得此版本,但是实际上在更改存档jessie向后移植后,可以得到的内容如下:

root@2ecaeffec483:/etc/apt# apt-cache policy openjdk-8-jdk
openjdk-8-jdk:
  Installed: (none)
  Candidate: 8u171-b11-1~bpo8+1
  Version table:
     8u171-b11-1~bpo8+1 0
        100 http://archive.debian.org/debian/ jessie-backports/main amd64 Packages

因此,您必须更改为下一个:

ENV JAVA_VERSION 8u171
ENV JAVA_DEBIAN_VERSION 8u171-b11-1~bpo8+1

此脚本将自动添加大多数丢失的 GPG 密钥:

#!/bin/bash

set -e

for PUBKEY in $(apt-get update 2>&1 | grep NO_PUBKEY | awk '{print $NF}')
do
 wget -q "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x${PUBKEY}" -O - | sed -n '/BEGIN/,/END/p' | apt-key add - 2>/dev/null
done

唯一的先决条件是安装wget 它也可以与curl一起使用。

3 NO_PUBKEY和KEYEXPIRED

当我尝试在Debian上使用apt-get update命令时,我发现自己陷入了这两个错误的错误循环:NO_PUBKEY和KEYEXPIRED W: There is no public key available for the following key IDs: 4D270D06F42 ...

6 公钥不可用

我正在尝试按照以下步骤在运行 Raspbian GNU7Linux 8 (Jessie) 的 Raspberry Pi 3 Model B 上安装 ROS Kinetic。 设置存储库我得到这个输出: 当尝试运行 sudo apt-get update 时,我收到此错误: 有人在添加公钥时 ...

8 为什么 PHP 的 ssh2_auth_pubkey_file 需要公钥?

我可以通过命令行仅使用私钥登录服务器。 为什么这个 PHP 函数也需要公钥? 我正在编写个人使用测试脚本,以在调整和部署新服务器时检查防火墙设置和访问权限。 我主要只是好奇,因为这似乎表明我缺少一些有关 ssh 如何工作的信息。 但我也很恼火,当我似乎只需要一条路径时,我不得不给出两条路径。 ...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2022 STACKOOM.COM