public key is not available の対処法

Uncategorized
581 words

TensorFlow 2によるオブジェクト検出API を試すため、Dockerビルドをしたところエラーに悩まされた。

エラー内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
PS D:\tensorflow\models> docker build -f research/object_detection/dockerfiles/tf2/Dockerfile -t od .
[+] Building 33.5s (7/16)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.39kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/tensorflow/tensorflow:2.2.0-gpu 2.6s
=> [auth] tensorflow/tensorflow:pull token for registry-1.docker.io 0.0s
=> CACHED [ 1/11] FROM docker.io/tensorflow/tensorflow:2.2.0-gpu@sha256:3f8f06cdfbc09c54568f191bbc54419b348ecc08 0.0s
=> [internal] load build context 0.2s
=> => transferring context: 252.57kB 0.2s
=> ERROR [ 2/11] RUN apt-get update && apt-get install -y git gpg-agent python3-cairocffi proto 30.8s
------
> [ 2/11] RUN apt-get update && apt-get install -y git gpg-agent python3-cairocffi protobuf-compiler python3-pil python3-lxml python3-tk wget:
#6 0.556 Get:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease [1575 B]
#6 0.633 Err:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease
#6 0.633 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
#6 0.691 Ign:2 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 InRelease
#6 0.705 Get:3 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 Release [564 B]
#6 0.720 Get:4 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 Release.gpg [833 B]
#6 0.789 Get:5 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 Packages [73.8 kB]
#6 1.019 Get:6 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
#6 1.188 Hit:7 http://archive.ubuntu.com/ubuntu bionic InRelease
#6 1.440 Get:8 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
#6 1.765 Get:9 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [2734 kB]
#6 2.385 Get:10 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
#6 2.912 Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [942 kB]
#6 6.617 Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [3168 kB]
#6 9.909 Get:13 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1498 kB]
#6 14.79 Get:14 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [909 kB]
#6 17.70 Get:15 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [21.1 kB]
#6 20.45 Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [2272 kB]
#6 29.86 Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [29.8 kB]
#6 29.98 Get:18 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [12.2 kB]
#6 30.02 Get:19 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [12.9 kB]
#6 30.08 Reading package lists...
#6 30.82 W: GPG error: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
#6 30.82 E: The repository 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease' is no longer signed.
------
executor failed running [/bin/bash -c apt-get update && apt-get install -y git gpg-agent python3-cairocffi protobuf-compiler python3-pil python3-lxml python3-tk wget]: exit code: 100

原因

CUDA Linux GPG リポジトリの鍵の更新 があったため。

対処法

Dockerfile に 次のコードを追加することでDockerビルドが出来るようになった。

1
2
RUN apt-key del 3bf863cc
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub