mysql:5.7 のコンテナで apt-update するとエラーになる

ショコラ
ショコラ

mysql:5.7 のコンテナで apt-update するとエラーになる

「apt-key adv –keyserver keyserver.ubuntu.com –recv-keys {NO_PUBKEY の値}」を実行してから apt-get update でキメマス。

もっさん先輩
もっさん先輩
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys {NO_PUBKEYの値}

手順

  1. mysql:5.7 のコンテナを起動します。
docker run --rm -it mysql:5.7 bash
  1. キーサーバー から新しいキーを取得します。
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29

「–recv-keys」に指定するキーは、シチュエーションの「NO_PUBKEYの値」467B942D3A79BD29 です。

  1. apt-get update が実行できます。
apt-get update

シチュエーション

mysql:5.7 のイメージで apt-get update するとエラーになった。

$ docker run --rm mysql:5.7 apt-get update
Get:1 http://deb.debian.org/debian buster InRelease [122 kB]
Get:2 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:3 http://repo.mysql.com/apt/debian buster InRelease [22.1 kB]
Get:4 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Err:3 http://repo.mysql.com/apt/debian buster InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
Get:5 http://deb.debian.org/debian buster/main amd64 Packages [7911 kB]
Get:6 http://security.debian.org/debian-security buster/updates/main amd64 Packages [328 kB]
Get:7 http://deb.debian.org/debian buster-updates/main amd64 Packages [8788 B]
Reading package lists... Done
W: GPG error: http://repo.mysql.com/apt/debian buster InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
E: The repository 'http://repo.mysql.com/apt/debian buster 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.
Scroll to Top