在 Docker 中 Ubuntu 添加密鑰時遇到的錯誤
Step 4/14 : RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
---> Running in dd67e1511194
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
The command '/bin/sh -c apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5' returned a non-zero code: 255
解決
在添加密鑰之前執(zhí)行
RUN apt-get update && apt-get install -y gnupg2