1. 程式人生 > 其它 >Mac docker構建映象apt-get update報GPG簽名錯誤解決

Mac docker構建映象apt-get update報GPG簽名錯誤解決

我正在使用python37作為基礎映象製作專案映象,但構建過程中執行apt-get update時出現GPG簽名錯誤

本地作業系統為Mac OS,docker 環境為desktop for docker :

Docker version 20.10.7, build f0df350

錯誤詳情:

Err:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
  At least one invalid signature was encountered.
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [107 kB]
Err:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease At least one invalid signature was encountered. Err:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease At least one invalid signature was encountered. Err:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease At least one invalid signature was encountered. Reading package lists... Done W: GPG error: http:
//ports.ubuntu.com/ubuntu-ports focal InRelease: At least one invalid signature was encountered. E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for
repository creation and user configuration details. W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease: At least one invalid signature was encountered. E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default.

解決方案:

docker image prune -a

會清理一些映象,然後再進行構建,就沒有報錯了

參考文章:stackoverflow

程式猿,要對自己狠一點!