cudaのGPG KeyエラーでDockerfileに追記すること
問題
今まで動いてたGPU対応のPytorch公式imageが動かなくなった。
なんでも、2022年の4月末にcudaパッケージリポジトリの署名鍵を更新したらしい。
実際に動かしたところ、apt updateの実行中に止まって以下のエラーが出た。
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 E: The repository 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease' is not signed.
対応
aptの署名鍵を更新する処理をapt update前に入れてあげるだけで済む。
具体的には以下3行をDockerfileに追記
なお、OSのディストリビューションやアーキテクチャが違う場合はurl上のubuntu1804, x86_64の部分を使うものに変更すること
# To fix GPG key error when running apt-get update RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
おわり
おしまい