如何从 python3.10-slim 映像内的内部 apt 镜像添加公共 PGP 密钥?

问题描述 投票:0回答:1

我需要在容器镜像中设置

apt
才能使用我们的内部 apt 镜像。 这将需要更改 apt 源、复制公钥、调整 apt 以使用代理,然后运行
apt update

我读过很多解决方案。问题是,他们要么有

apt-key
,要么有
gpg
。我的图像是 python3.10-slim,但它没有。在我将镜像设置为进行任何安装之前,我无法做任何事情。所以我只能使用这张图片上的任何内容。
我有 pgp 公钥,我可以将其复制到容器中。我如何强制 apt 信任它?

python docker containers apt pgp
1个回答
0
投票
apt install

)即可进行初始获取!

/etc/apt/sources.list

在你的 Dockerfile 中,这可能是

deb [trusted=yes] http://repo distro component

© www.soinside.com 2019 - 2024. All rights reserved.