<p>I'm trying build a docker container with the following command:</p>
<pre><code>sudo docker build docker_calculadora/
</code></pre>
<p>but when it's building, at the step 9 it appears the following error:</p>
<p>Step 9/27 : RUN set -ex;    export GNUPGHOME=&quot;$(mktemp -d)&quot;;    for key in $GPG_KEYS; do        gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys &quot;$key&quot;;  done;   gpg --batch --export $GPG_KEYS &gt; /etc/apt/trusted.gpg.d/mariadb.gpg;    command -v gpgconf &gt; /dev/null &amp;&amp; gpgconf --kill all || :;  rm -r &quot;$GNUPGHOME&quot;;     apt-key list
---&gt; Running in a80677ab986c</p>
<ul>
<li>mktemp -d</li>
<li>export GNUPGHOME=/tmp/tmp.TiWBSXwFOS</li>
<li>gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 177F4010FE56CA3336300305F1656F24C74CD1D8
gpg: keybox '/tmp/tmp.TiWBSXwFOS/pubring.kbx' created
gpg: keyserver receive failed: No name
The command '/bin/sh -c set -ex;    export GNUPGHOME=&quot;$(mktemp -d)&quot;;    for key in $GPG_KEYS; do        gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys &quot;$key&quot;;  done;   gpg --batch --export $GPG_KEYS &gt; /etc/apt/trusted.gpg.d/mariadb.gpg;    command -v gpgconf &gt; /dev/null &amp;&amp; gpgconf --kill all || :;  rm -r &quot;$GNUPGHOME&quot;;     apt-key list' returned a non-zero code: 2</li>
</ul>
<p>My DockerFile:</p>
<pre><code># 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 &amp;&amp; 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 &quot;gnupg&quot; (not &quot;gnupg2&quot;, 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=&quot;$(apt-mark showmanual)&quot;; \
    apt-get update; \
    apt-get install -y --no-install-recommends ca-certificates wget; \
    rm -rf /var/lib/apt/lists/*; \
    dpkgArch=&quot;$(dpkg --print-architecture | awk -F- '{ print $NF }')&quot;; \
    wget -O /usr/local/bin/gosu &quot;https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch&quot;; \
    wget -O /usr/local/bin/gosu.asc &quot;https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc&quot;; \
    export GNUPGHOME=&quot;$(mktemp -d)&quot;; \
    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 &quot;$GNUPGHOME&quot; /usr/local/bin/gosu.asc; \
    apt-mark auto '.*' &gt; /dev/null; \
    [ -z &quot;$savedAptMark&quot; ] || apt-mark manual $savedAptMark &gt; /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 &quot;pwgen&quot; for randomizing passwords
# install &quot;tzdata&quot; for /usr/share/zoneinfo/
# install &quot;xz-utils&quot; 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 &lt;signing-key@mariadb.org&gt;
# sub   rsa4096 2016-03-30 [E]
    177F4010FE56CA3336300305F1656F24C74CD1D8
RUN set -ex; \
    export GNUPGHOME=&quot;$(mktemp -d)&quot;; \
    for key in $GPG_KEYS; do \
        gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys &quot;$key&quot;; \
    done; \
    gpg --batch --export $GPG_KEYS &gt; /etc/apt/trusted.gpg.d/mariadb.gpg; \
    command -v gpgconf &gt; /dev/null &amp;&amp; gpgconf --kill all || :; \
    rm -r &quot;$GNUPGHOME&quot;; \
    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 &quot;deb http://ftp.osuosl.org/pub/mariadb/repo/$MARIADB_MAJOR/ubuntu focal main&quot; &gt; /etc/apt/sources.list.d/mariadb.list; \
    { \
        echo 'Package: *'; \
        echo 'Pin: release o=MariaDB'; \
        echo 'Pin-Priority: 999'; \
    } &gt; /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 &quot;/var/lib/mysql&quot; 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 &quot;configured&quot; (ie, stuff in /var/lib/mysql/mysql)
# also, we set debconf keys to make APT a little quieter
RUN set -ex; \
    { \
        echo &quot;mariadb-server-$MARIADB_MAJOR&quot; mysql-server/root_password password 'unused'; \
        echo &quot;mariadb-server-$MARIADB_MAJOR&quot; mysql-server/root_password_again password 'unused'; \
    } | debconf-set-selections; \
    apt-get update; \
    apt-get install -y \
        &quot;mariadb-server=$MARIADB_VERSION&quot; \
# 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)/#&amp;/'; \
# don't reverse lookup hostnames, they are usually another container
    echo '[mysqld]\nskip-host-cache\nskip-name-resolve' &gt; /etc/mysql/conf.d/docker.cnf

VOLUME /var/lib/mysql

COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT [&quot;docker-entrypoint.sh&quot;]

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 [&quot;/start.sh&quot;]
'''
</code></pre>

Nat
<p>The error is because some servers that used the Mariadb image in the Dockerfile are down. Just need to update them.</p>
