19.2. 在容器中运行 Skopeo
您可以使用 Skopeo 检查远程容器镜像。在容器中运行 Skopeo 意味着容器根文件系统与主机 root 文件系统分离。要在主机和容器间共享或复制文件,您必须挂载文件和目录。
先决条件
-
container-tools元数据包已安装。
流程
登录到 registry.redhat.io 注册中心:
$ podman login registry.redhat.io Username: myuser@mycompany.com Password: <password> Login Succeeded!获取
registry.redhat.io/rhel10/skopeo容器镜像:$ podman pull registry.redhat.io/rhel10/skopeo使用 Skopeo 检查远程容器镜像
registry.access.redhat.com/ubi10/ubi:$ podman run --rm registry.redhat.io/rhel10/skopeo \ skopeo inspect docker://registry.access.redhat.com/ubi10/ubi { "Name": "registry.access.redhat.com/ubi10/ubi", ... "Labels": { "architecture": "x86_64", ... "name": "ubi10", ... "summary": "Provides the latest release of Red Hat Universal Base Image 10.", "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/ubi10/images/8.2-347", ... }, "Architecture": "amd64", "Os": "linux", "Layers": [ ... ], "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "container=oci" ] }--rm选项会在容器退出后删除registry.redhat.io/rhel10/skopeo镜像。