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

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

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

问题

Dockerfile中,它写成了这样:

  1. FROM osgeo/gdal:ubuntu-small-3.6.3
  2. RUN apt-get install --no-install-recommends -y gnupg
  3. RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C

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

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

  1. FROM osgeo/gdal:ubuntu-small-3.6.3
  2. RUN apt-get install --no-install-recommends -y gnupg
  3. RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C

While I built, it shows this error:

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

我找到了解决方案。

我只是将

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

改成了

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

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

英文:

I got my solution.

I just changed

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

to

  1. COPY select-path-frames/apt-key.txt ./
  2. 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:

确定