使用php:8.2-fpm的docker镜像时,执行apt-get命令出现了大量错误

我认为这只是暂时的记录……

事件

作为一个事实,这就是。

 

在 Docker 镜像中

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

出现了大量错误,无法通过构建,处于这种状态。

为什么

最新版本的php图像在debian上有更新。
https://github.com/docker-library/official-images/commit/c89c5a02bcb9afca6f5d8676849c54dc627bbca7

据说版本从 bullseye(11系) 更新到了 bookworm(12系),然后 apt 就不能用了。

以下链接提供有关Debian版本的信息:
https://www.debian.org/releases/index.en.html

解决方案 (jiě jué àn)

这里有一份写着的信息。
https://github.com/docker-library/php/issues/1417#issuecomment-1591841905

基于Debian的PHP Docker镜像有一个可指定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に解決方法が載っているんだからしっかり読めば暫定対応はすぐできたな

解決までに半日ぐらい調べものした

とは言え、事象の原因も解決方法もちゃんと理解出来たから良かった
とりあえずこれ怖い・・・

广告
将在 10 秒后关闭
bannerAds