19.2. 在容器中运行 Skopeo


您可以使用 Skopeo 检查远程容器镜像。在容器中运行 Skopeo 意味着容器根文件系统与主机 root 文件系统分离。要在主机和容器间共享或复制文件,您必须挂载文件和目录。

先决条件

  • container-tools 元数据包已安装。

流程

  1. 登录到 registry.redhat.io 注册中心:

    $ podman login registry.redhat.io
    Username: myuser@mycompany.com
    Password: <password>
    Login Succeeded!
  2. 获取 registry.redhat.io/rhel10/skopeo 容器镜像:

    $ podman pull registry.redhat.io/rhel10/skopeo
  3. 使用 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 镜像。

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部