背景:用镜像拉起的mysql5.6.44的容器,os是Debian GNU/Linux 9 (stretch)
这个错误表明系统仍在使用 Debian 9 (Stretch),但该版本已于 2022年6月30日 结束生命周期(EOL),官方仓库已下线。

解决方案
# 进入容器
docker exec -it <container_name> bash
# 导入 Debian 归档密钥
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA8E81B4331F7F50 112695A0E562B32A 04E7233B7D453EEC EF0F382A1A7B6500 648ACFD622F3D138 0E98404D386FA1D9
# 修改 apt 源为归档镜像
cat > /etc/apt/sources.list << 'EOF'
deb http://archive.debian.org/debian/ stretch main contrib non-free
deb http://archive.debian.org/debian-security stretch/updates main contrib non-free
EOF
# 清理并更新(忽略有效期)
rm -rf /etc/apt/sources.list.d/mysql.list
apt-get clean
apt-get update -o Acquire::Check-Valid-Until=false -o Acquire::AllowInsecureRepositories=true || true
# 允许未签名安装(应急)
apt-get install -y --allow-unauthenticated <package_name>
