我该如何安装GPGVgpg
, (以及其中之一的精简版辅助工具)?我正在寻找一个可以使用的解决方案光子操作系统容器,无需安装完整的gpg
.
我知道在 Ubuntu 上可以做到sudo apt install gpgv2
这一点,我认为只需要“52.2 KB额外的磁盘空间”。
Photon OS 使用yum
,所以我尝试了:
# yum install gpgv2
gpgv2 package not found or not installed
Error(1011) : No matching packages
# yum install gpgv
gpgv package not found or not installed
Error(1011) : No matching packages
# yum search gpgv
Error(1599) : No matches found
# yum search gpg
photon-repos : Photon repo files, gpg keys
password-store : A secure password manager for unix systems.
photon-repos : Photon repo files, gpg keys
gnupg : OpenPGP standard implementation used for encrypted communication and data storage.
gpgme : High-Level Crypto API
gpgme-devel : Static libraries and header files from GPGME, GnuPG Made Easy.
libgpg-error : libgpg-error
libgpg-error-devel : Libraries and header files for libgpg-error
libgpg-error-lang : Additional language files for libgpg-error
tdnf-plugin-repogpgcheck : tdnf plugin providign gpg verification for repository metadata
gnupg : OpenPGP standard implementation used for encrypted communication and data storage.
gpgme : High-Level Crypto API
gpgme-devel : Static libraries and header files from GPGME, GnuPG Made Easy.
libassuan-devel : GnuPG IPC library
password-store : A secure password manager for unix systems.
photon-repos : Photon repo files, gpg keys
tdnf-plugin-repogpgcheck : tdnf plugin providign gpg verification for repository metadata
最终我同意了,yum install gnupg
但它确实提供了gpgv
,但代价是11.80M。是否有手动或替代方式获取仅有的 gpgv
?这就是我在容器中所需要的,因为它是签名验证所必需的。谢谢你!
答案1
您可以使用多阶段 Dockerfile 获得您想要的内容:
FROM docker.io/photon:latest AS builder
RUN yum -y install gnupg
FROM docker.io/photon:latest
COPY --from=builder /usr/bin/gpgv /usr/bin
COPY --from=builder /lib64/libgcrypt.so.20 /lib64/libgcrypt-error.so.0 /lib64/
但是,除非您在资源极其有限的环境中运行,否则我会安装该gnupg
软件包并将其保留在该位置(或将基本发行版切换为单独打包的发行版gpgv
)。