基于TensorFlow 2.4.3构建Docker镜像时出现公钥验证错误
TensorFlow 2.4.3-gpu镜像构建时apt-get update GPG密钥错误问题解决
是的,这个问题确实是因为TensorFlow 2.4.3-gpu镜像版本过旧导致的。
旧版本的TensorFlow GPU镜像预装的NVIDIA CUDA仓库GPG密钥已经失效,而NVIDIA后续更换了仓库签名密钥。新版本的TensorFlow镜像已经同步更新了密钥配置,所以相同的Dockerfile在最新镜像上能正常运行。
解决方法
在apt-get -y update步骤前,添加导入NVIDIA新GPG密钥的命令即可修复:
修改后的Dockerfile如下:
FROM tensorflow/tensorflow:2.4.3-gpu ADD . /path WORKDIR /path # 导入NVIDIA CUDA仓库的有效GPG密钥 RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub RUN apt-get -y update RUN apt-get -y install sudo
如果上述密钥地址无法访问,也可以尝试导入NVIDIA容器运行时的主密钥:
RUN apt-key adv --fetch-keys https://nvidia.github.io/nvidia-container-runtime/gpgkey
内容的提问来源于stack exchange,提问作者Corentin Salomon
相关产品推荐
相关产品推荐

