`RUN apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 871920D1991BC93C` 返回错误。

huangapple go评论87阅读模式
英文:

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C returns error

问题

Dockerfile中,它写成了这样:

FROM osgeo/gdal:ubuntu-small-3.6.3

RUN apt-get install --no-install-recommends -y gnupg
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C

在构建时,出现了以下错误:

 => [internal] load build definition from Dockerfile                                                                                                         0.0s 
 => => transferring dockerfile: 1.13kB                                                                                                                       0.0s 
 => [internal] load .dockerignore                                                                                                                            0.0s 
 => => transferring context: 2B                                                                                                                              0.0s 
 => [internal] load metadata for docker.io/osgeo/gdal:ubuntu-small-3.6.3                                                                                     4.8s 
 => [auth] osgeo/gdal:pull token for registry-1.docker.io                                                                                                    0.0s 
 => [ 1/13] FROM docker.io/osgeo/gdal:ubuntu-small-3.6.3@sha256:398d5aca0ca88295c13ada87e0f382ed409dac13a952461187be72ce3c376513                             0.0s 
 => [internal] load build context                                                                                                                            0.1s 
 => => transferring context: 106.80kB                                                                                                                        0.0s 
 => CACHED [ 2/13] RUN apt-get install --no-install-recommends -y gnupg                                                                                      0.0s 
 => ERROR [ 3/13] RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C 
------
> [ 3/13] RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C:
#7 0.565 Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
#7 0.586 Executing: /tmp/apt-key-gpghome.sBrxtWnhQq/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C
#7 10.62 gpg: keyserver receive failed: Server indicated a failure
------
executor failed running [/bin/sh -c apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C]: exit code: 2

[注意:我使用的是Windows 11 Pro]

有人知道如何修复吗?

英文:

In the Dockerfile it has written like this:

FROM osgeo/gdal:ubuntu-small-3.6.3

RUN apt-get install --no-install-recommends -y gnupg
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C

While I built, it shows this error:

 => [internal] load build definition from Dockerfile                                                                                                         0.0s 
 => => transferring dockerfile: 1.13kB                                                                                                                       0.0s 
 => [internal] load .dockerignore                                                                                                                            0.0s 
 => => transferring context: 2B                                                                                                                              0.0s 
 => [internal] load metadata for docker.io/osgeo/gdal:ubuntu-small-3.6.3                                                                                     4.8s 
 => [auth] osgeo/gdal:pull token for registry-1.docker.io                                                                                                    0.0s 
 => [ 1/13] FROM docker.io/osgeo/gdal:ubuntu-small-3.6.3@sha256:398d5aca0ca88295c13ada87e0f382ed409dac13a952461187be72ce3c376513                             0.0s 
 => [internal] load build context                                                                                                                            0.1s 
 => => transferring context: 106.80kB                                                                                                                        0.0s 
 => CACHED [ 2/13] RUN apt-get install --no-install-recommends -y gnupg                                                                                      0.0s 
 => ERROR [ 3/13] RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C 
------
> [ 3/13] RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C:
#7 0.565 Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
#7 0.586 Executing: /tmp/apt-key-gpghome.sBrxtWnhQq/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C
#7 10.62 gpg: keyserver receive failed: Server indicated a failure
------
executor failed running [/bin/sh -c apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C]: exit code: 2

[Note: I am using WINDOWS 11 Pro]

Does anybody have idea how to fix it?

答案1

得分: 1

我找到了解决方案。

我只是将

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C

改成了

COPY select-path-frames/apt-key.txt ./
RUN cat ./apt-key.txt | apt-key add -

我的 apt-key.txt 文件包含了从这里下载的此版本的密钥 https://keyserver.ubuntu.com/

英文:

I got my solution.

I just changed

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C

to

COPY select-path-frames/apt-key.txt ./
RUN cat ./apt-key.txt | apt-key add -

My apt-key.txt file contains the key of this version which was downloaded from here https://keyserver.ubuntu.com/

huangapple
  • 本文由 发表于 2023年5月24日 17:15:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76321902.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定