LoginSignup
6
0

php:8.2-fpmのdocker imageでapt-getしたらエラーが出まくった

Posted at

一時的なものかと思いますが忘備録として・・・

事象

事象としてはこれです

docker imageの中で

RUN apt-get update && apt-get -y install hoge moge fuga

ってしたら

Reading package lists...
W: GPG error: http://deb.debian.org/debian bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY F8D2585B8783D481
E: The repository 'http://deb.debian.org/debian bookworm InRelease' is not signed.
W: GPG error: http://deb.debian.org/debian bookworm-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
E: The repository 'http://deb.debian.org/debian bookworm-updates InRelease' is not signed.
W: GPG error: http://deb.debian.org/debian-security bookworm-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8
E: The repository 'http://deb.debian.org/debian-security bookworm-security InRelease' is not signed.
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code

エラーが出まくってbuildが通らないって状態です

原因

phpのimageでdebianの更新がありました
https://github.com/docker-library/official-images/commit/c89c5a02bcb9afca6f5d8676849c54dc627bbca7

バージョンが bullseye(11系) -> bookworm(12系) に更新されてaptが通らなくなったみたいです

※Debianのバージョンについてはこちら
https://www.debian.org/releases/index.en.html

解決方法

ここに書いてありました
https://github.com/docker-library/php/issues/1417#issuecomment-1591841905

debianをベースとしたphpのdocker imageは、debianのバージョンを指定出来るタグがあります

※該当箇所の抜粋

Image Variants
The php images come in many flavors, each designed for a specific use case.

Some of these tags may have names like bookworm, bullseye, or buster in them. These are the suite code names for releases of Debian and indicate which release the image is based on. If your image needs to install any additional packages beyond what comes with the image, you'll likely want to specify one of these explicitly to minimize breakage when there are new releases of Debian.

なので、 php:8.2-fpm -> php:8.2-fpm-bullseye で解消されました

まとめ

  • issueの確認を速やかに出来て良かった
  • っていうかissueに解決方法が載っているんだからしっかり読めば暫定対応はすぐできたな
    • 解決までに半日ぐらい調べものした
  • とは言え、事象の原因も解決方法もちゃんと理解出来たから良かった
  • とりあえずこれ怖い・・・
6
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
0