公钥不可用:NO_PUBKEY F76221572C52609D [英] public key is not available: NO_PUBKEY F76221572C52609D

查看:128
本文介绍了公钥不可用:NO_PUBKEY F76221572C52609D的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于以下docker文件:

For the below docker file:

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行的命令生成映像失败


build image is failing for command at line #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)" ]


有错误:


with error:

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

W: GPG error: https://apt.dockerproject.org debian-jessie InRelease: The following signatures couldn't be verified because the public key is not available: 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

/var/lib/apt/lists/* && [ "$JAVA_HOME" = "$(docker-java-home)" ]' returned a non-zero code: 100


如何解决公钥错误?


How public key error can get resolved?

推荐答案

这里有几个问题:

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

1) W: GPG error: https://apt.dockerproject.org debian-jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F76221572C52609D W: There is no public key available for the following key IDs: AA8E81B4331F7F50

解决方案:

将密钥服务器添加操作移至RUN echo 'deb http://deb.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list之前的位置,同时还将AA8E81B4331F7F50添加为下一个:

Move the keyserver add actions to the place before RUN echo 'deb http://deb.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list, meanwhile add AA8E81B4331F7F50 also as next:

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:某些索引文件下载失败.它们已被忽略,或改用旧的.

2) W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

解决方案:

microsoft/aspnetcore-build:1.0.1基于debian8,并且您想使用openjdk8,默认情况下,该目录不在apt信息库中.因此,您使用deb http://deb.debian.org/debian jessie-backports main.

microsoft/aspnetcore-build:1.0.1 base on debian8, and you want to use openjdk8 which was default not in apt repository. So you use deb http://deb.debian.org/debian jessie-backports main.

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

Unfortunately, if you check http://ftp.debian.org/debian/dists/, you will find jessie-backports had been removed. So you had to switch to archived url like next (Comment the old url, just use the url next):

#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

同时,您必须在完成上述操作后添加下一个,以解决

Meanwhile, you had to add next after doing above to resolve 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

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

解决方案:

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

Not sure how you get this version, but in fact after change to archive jessie backports, what you could get is something like next:

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

因此,您必须转到下一个:

So, you had to change to next:

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

这篇关于公钥不可用:NO_PUBKEY F76221572C52609D的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆