Raspberry Pi 上の Ubuntu コンテナで apt update すると The repository 'http...' is not signed. が発生する

現象

$ docker run --rm -it ubuntu:21.04
root@f35370427219:/# date
Thu Jan  1 00:00:00 UTC 1970
root@f35370427219:/# apt update
Get:1 http://ports.ubuntu.com/ubuntu-ports hirsute InRelease [269 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports hirsute-updates InRelease [90.7 kB]                                                                                                                                    
Err:1 http://ports.ubuntu.com/ubuntu-ports hirsute InRelease                                                                                                                                                      
  At least one invalid signature was encountered.
Get:3 http://ports.ubuntu.com/ubuntu-ports hirsute-backports InRelease [90.7 kB]
Err:2 http://ports.ubuntu.com/ubuntu-ports hirsute-updates InRelease                                                                                                                                              
  At least one invalid signature was encountered.
Err:3 http://ports.ubuntu.com/ubuntu-ports hirsute-backports InRelease                                                                                                                                            
  At least one invalid signature was encountered.
Get:4 http://ports.ubuntu.com/ubuntu-ports hirsute-security InRelease [90.7 kB]                                                                                                                                   
Err:4 http://ports.ubuntu.com/ubuntu-ports hirsute-security InRelease                                                                                                                                             
  At least one invalid signature was encountered.
Reading package lists... Done                                                                                                                                                                                     
W: GPG error: http://ports.ubuntu.com/ubuntu-ports hirsute InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports hirsute 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 hirsute-updates InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports hirsute-updates 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 hirsute-backports InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports hirsute-backports 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 hirsute-security InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports hirsute-security 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.

対応

調べたら情報がありました。ちょっと見た感じ、特定の Ubuntu イメージとラズパイの組み合わせで起こるのかもしれません。 askubuntu.com

上記ページでも書かれていますが Ubuntu 18.04 だと動作しました。
最新イメージでなくてもいいので、これで良しとします。

$ docker run --rm -it ubuntu:18.04
root@4d6241812f23:/# date
Thu Feb 25 15:23:43 UTC 2021
root@4d6241812f23:/# apt update
Get:1 http://ports.ubuntu.com/ubuntu-ports bionic InRelease [242 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports bionic-updates InRelease [88.7 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports bionic-backports InRelease [74.6 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease [88.7 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports bionic/main armhf Packages [1277 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports bionic/restricted armhf Packages [12.5 kB]
Get:7 http://ports.ubuntu.com/ubuntu-ports bionic/multiverse armhf Packages [157 kB]
Get:8 http://ports.ubuntu.com/ubuntu-ports bionic/universe armhf Packages [11.0 MB]
Get:9 http://ports.ubuntu.com/ubuntu-ports bionic-updates/restricted armhf Packages [14.9 kB]
Get:10 http://ports.ubuntu.com/ubuntu-ports bionic-updates/universe armhf Packages [1782 kB]
Get:11 http://ports.ubuntu.com/ubuntu-ports bionic-updates/main armhf Packages [1358 kB]
Get:12 http://ports.ubuntu.com/ubuntu-ports bionic-updates/multiverse armhf Packages [7497 B]
Get:13 http://ports.ubuntu.com/ubuntu-ports bionic-backports/main armhf Packages [11.2 kB]
Get:14 http://ports.ubuntu.com/ubuntu-ports bionic-backports/universe armhf Packages [11.0 kB]
Get:15 http://ports.ubuntu.com/ubuntu-ports bionic-security/main armhf Packages [984 kB]
Get:16 http://ports.ubuntu.com/ubuntu-ports bionic-security/multiverse armhf Packages [3499 B]
Get:17 http://ports.ubuntu.com/ubuntu-ports bionic-security/restricted armhf Packages [8087 B]
Get:18 http://ports.ubuntu.com/ubuntu-ports bionic-security/universe armhf Packages [1103 kB]
Fetched 18.2 MB in 7s (2525 kB/s)                                                                                                                                                                                 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.