当前位置: 首页 > 知识库问答 >
问题:

Docker构建错误:“gpg:keyserver接收失败:没有名称”

牛凌
2023-03-14

我正在尝试使用以下命令构建一个docker容器:

sudo docker build docker_calculadora/

但是当它构建时,在第9步出现以下错误:

    null
# vim:set ft=dockerfile:
FROM ubuntu:focal

# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mysql && useradd -r -g mysql mysql

# https://bugs.debian.org/830696 (apt uses gpgv by default in newer releases, rather than gpg)
RUN set -ex; \
    apt-get update; \
    if ! which gpg; then \
        apt-get install -y --no-install-recommends gnupg; \
fi; \
    if ! gpg --version | grep -q '^gpg (GnuPG) 1\.'; then \
# Ubuntu includes "gnupg" (not "gnupg2", but still 2.x), but not dirmngr, and gnupg 2.x requires dirmngr
# so, if we're not running gnupg 1.x, explicitly install dirmngr too
        apt-get install -y --no-install-recommends dirmngr; \
    fi; \
    rm -rf /var/lib/apt/lists/*

# add gosu for easy step-down from root
# https://github.com/tianon/gosu/releases
ENV GOSU_VERSION 1.12
RUN set -eux; \
    savedAptMark="$(apt-mark showmanual)"; \
    apt-get update; \
    apt-get install -y --no-install-recommends ca-certificates wget; \
    rm -rf /var/lib/apt/lists/*; \
    dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
    wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
    wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
    export GNUPGHOME="$(mktemp -d)"; \
    gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
    gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
    gpgconf --kill all; \
    rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
    apt-mark auto '.*' > /dev/null; \
    [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
    apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
    chmod +x /usr/local/bin/gosu; \
    gosu --version; \
    gosu nobody true

RUN mkdir /docker-entrypoint-initdb.d

# install "pwgen" for randomizing passwords
# install "tzdata" for /usr/share/zoneinfo/
# install "xz-utils" for .sql.xz docker-entrypoint-initdb.d files
RUN set -ex; \
    apt-get update; \
    apt-get install -y --no-install-recommends \
        pwgen \
        tzdata \
        xz-utils \
    ; \
    rm -rf /var/lib/apt/lists/*

ENV GPG_KEYS \
# pub   rsa4096 2016-03-30 [SC]
#         177F 4010 FE56 CA33 3630  0305 F165 6F24 C74C D1D8
# uid           [ unknown] MariaDB Signing Key <signing-key@mariadb.org>
# sub   rsa4096 2016-03-30 [E]
    177F4010FE56CA3336300305F1656F24C74CD1D8
RUN set -ex; \
    export GNUPGHOME="$(mktemp -d)"; \
    for key in $GPG_KEYS; do \
        gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
    done; \
    gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \
    command -v gpgconf > /dev/null && gpgconf --kill all || :; \
    rm -r "$GNUPGHOME"; \
    apt-key list

# bashbrew-architectures: amd64 arm64v8 ppc64le
ENV MARIADB_MAJOR 10.5
ENV MARIADB_VERSION 1:10.5.8+maria~focal
# release-status:Stable
# (https://downloads.mariadb.org/mariadb/+releases/)

RUN set -e;\
    echo "deb http://ftp.osuosl.org/pub/mariadb/repo/$MARIADB_MAJOR/ubuntu focal main" > /etc/apt/sources.list.d/mariadb.list; \
    { \
        echo 'Package: *'; \
        echo 'Pin: release o=MariaDB'; \
        echo 'Pin-Priority: 999'; \
    } > /etc/apt/preferences.d/mariadb
# add repository pinning to make sure dependencies from this MariaDB repo are preferred over Debian dependencies
#  libmariadbclient18 : Depends: libmysqlclient18 (= 5.5.42+maria-1~wheezy) but 5.5.43-0+deb7u1 is to be installed

# the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql)
# also, we set debconf keys to make APT a little quieter
RUN set -ex; \
    { \
        echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password password 'unused'; \
        echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password_again password 'unused'; \
    } | debconf-set-selections; \
    apt-get update; \
    apt-get install -y \
        "mariadb-server=$MARIADB_VERSION" \
# mariadb-backup is installed at the same time so that `mysql-common` is only installed once from just mariadb repos
        mariadb-backup \
        socat \
    ; \
    rm -rf /var/lib/apt/lists/*; \
# purge and re-create /var/lib/mysql with appropriate ownership
    rm -rf /var/lib/mysql; \
    mkdir -p /var/lib/mysql /var/run/mysqld; \
    chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime
    chmod 777 /var/run/mysqld; \
# comment out a few problematic configuration values
    find /etc/mysql/ -name '*.cnf' -print0 \
        | xargs -0 grep -lZE '^(bind-address|log|user\s)' \
        | xargs -rt -0 sed -Ei 's/^(bind-address|log|user\s)/#&/'; \
# don't reverse lookup hostnames, they are usually another container
    echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf

VOLUME /var/lib/mysql

COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]

EXPOSE 3306
RUN apt-get update
#RUN apt-get install -y software-properties-common
#RUN apt-get update
RUN apt-get install -y apache2 curl nano php libapache2-mod-php php7.4-mysql
EXPOSE 80

COPY calculadora.html /var/www/html/
COPY calculadora.php /var/www/html/
COPY success.html    /var/www/html/
COPY start.sh /
COPY 50-server.cnf /etc/mysql/mariadb.conf.d/
RUN chmod 777 /start.sh 
CMD ["/start.sh"]
'''

共有1个答案

丁阳炎
2023-03-14

该错误是因为在Dockerfile中使用Mariadb映像的一些服务器已关闭。只需要更新它们。

 类似资料:
  • 当我为android构建我的Ionic应用程序时,它会出现错误。当我为iOS做同样的事情时,但没有问题插件列表附在下面 **插件列表** com-badrit-base 64 0.2.0”Base64”cordova-clipboard 1.3.0”剪贴板”cordova-plugin-add-swift-support 2.0.2”AddSwiftSupport”cordov-plugin-ba

  • 问题内容: 今天,我第一次在Fedora 21上安装了docker。现在,我需要从默认的/ var / lib / docker更改docker images文件夹的位置。 复制文件(跳过devicemapper子文件夹,docker服务停止)并更改/ etc / sysconfig / docker(添加- g选项)后,我再次运行docker service,没有问题,devicemapper

  • 问题内容: 我已使用本教程创建了我的第一个docker webapi项目。 我正在使用Windows 7(Docker工具箱)。 这是我跑过的: 这是Dockerfile: 这是我创建图像的方式: 这就是我创建和运行容器的方式: 我的服务作为docker容器成功运行。 然后,我尝试更改Dockerfile以在aspnetcore基本映像上工作: 改为 新的Dockerfile如下所示: 现在,我尝

  • 为什么我会出现以下错误?突然,它开始出现这个错误。 失败:生成失败,出现异常。 > 其中:脚本'C:\src\flutter\package\flutter_tools\gradle\flutter.gradle'行:1070 错误:任务:app:compileFlutterBuildDebug的执行失败。 处理“命令”C:\src\flatter\bin\flatter。bat“”以非零退出值1

  • 这是我编写的Dockerfile文件,但是构建镜像的时候发现没有执行npm install,自然也不会有dist文件,不知道是哪里写的有问题,请教一下大家

  • 无法生成ionic cordova build android--prod配置项目时出现问题:app'。 未指定compileSdkVersion。请将其添加到构建中。格拉德尔 build.gradle(app) /*根据一个或多个投稿者许可协议授权给Apache软件基金会(ASF)。有关版权所有权的更多信息,请参阅随本作品一起分发的通知文件。ASF根据Apache许可证2.0版(以下简称“许可证