8.20. 容器
使用 Beta GPG 密钥签名的容器镜像无法拉取
目前,当您试图拉取 RHEL 9 Beta 容器镜像时,podman
会退出并显示错误消息:Error:Source image rejected:None of the signatures were accepted
。镜像因为当前构建被配置为不信任 RHEL Beta GPG 密钥而无法拉取。
作为临时解决方案,请确保红帽 Beta GPG 密钥保存在您的本地系统中,并使用针对适当的 beta 命名空间更新 podman image trust set
命令的现有信任范围。
如果您没有本地存储 Beta GPG 密钥,您可以通过运行以下命令来拉取它:
sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta https://www.redhat.com/security/data/f21541eb.txt
sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta https://www.redhat.com/security/data/f21541eb.txt
要将 Beta GPG 密钥作为信任添加到命名空间中,请使用以下命令之一:
sudo podman image trust set -f /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta registry.access.redhat.com/namespace
$ sudo podman image trust set -f /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta registry.access.redhat.com/namespace
和
sudo podman image trust set -f /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta registry.redhat.io/namespace
$ sudo podman image trust set -f /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta registry.redhat.io/namespace
将 namespace 替换为 ubi9-beta 或 rhel9-beta。
Podman 无法拉取容器 "X509: certificate signed by unknown authority"
如果您的内部注册中心由自己的 CA 证书签名,则必须将证书导入到主机上。否则,会发生错误:
x509: certificate signed by unknown authority
x509: certificate signed by unknown authority
在主机上导入 CA 证书:
cd /etc/pki/ca-trust/source/anchors/
# cd /etc/pki/ca-trust/source/anchors/
[anchors]# curl -O <your_certificate>.crt
[anchors]# update-ca-trust
然后,您可以从内部注册中心拉取容器镜像。
在较旧的容器镜像中运行 systemd 无法正常工作
在较旧的容器镜像中运行 systemd,如 centos:7
,它无法正常工作:
podman run --rm -ti centos:7 /usr/lib/systemd/systemd
$ podman run --rm -ti centos:7 /usr/lib/systemd/systemd
Storing signatures
Failed to mount cgroup at /sys/fs/cgroup/systemd: Operation not permitted
[!!!!!!] Failed to mount API filesystems, freezing.
要临时解决这个问题,请使用以下命令:
mkdir /sys/fs/cgroup/systemd mount none -t cgroup -o none,name=systemd /sys/fs/cgroup/systemd podman run --runtime /usr/bin/crun --annotation=run.oci.systemd.force_cgroup_v1=/sys/fs/cgroup --rm -ti centos:7 /usr/lib/systemd/systemd
# mkdir /sys/fs/cgroup/systemd
# mount none -t cgroup -o none,name=systemd /sys/fs/cgroup/systemd
# podman run --runtime /usr/bin/crun --annotation=run.oci.systemd.force_cgroup_v1=/sys/fs/cgroup --rm -ti centos:7 /usr/lib/systemd/systemd
(JIRA:RHELPLAN-96940)
podman system connection add
和 podman image scp
失败
Podman 为 RSA 密钥交换使用 SHA-1 哈希。在使用 RSA 密钥的机器间,常规的 SSH 连接可以正常工作,但使用相同 RSA 密钥的 podman system connection add
和 podman image scp
无法正常工作,这是因为在 RHEL 9 的密钥交换中不接受 SHA-1 哈希:
podman system connection add --identity ~/.ssh/id_rsa test_connection $REMOTE_SSH_MACHINE
$ podman system connection add --identity ~/.ssh/id_rsa test_connection $REMOTE_SSH_MACHINE
Error: failed to connect: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
要临时解决这个问题,使用 ED25519 密钥:
连接到远程机器:
ssh -i ~/.ssh/id_ed25519 $REMOTE_SSH_MACHINE
$ ssh -i ~/.ssh/id_ed25519 $REMOTE_SSH_MACHINE
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 为 Podman 服务记录 ssh 目标:
podman system connection add --identity ~/.ssh/id_ed25519 test_connection $REMOTE_SSH_MACHINE
$ podman system connection add --identity ~/.ssh/id_ed25519 test_connection $REMOTE_SSH_MACHINE
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 验证 ssh 目标是否已记录:
podman system connection list
$ podman system connection list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
请注意,随着 RHBA-2022:5951 公告的发布,这个问题已被解决。
(JIRA:RHELPLAN-121180)