3.4. 配置 Satellite CV ,并将其用作内容源


您可以使用 Satellite 的内容视图(CV)作为自定义存储库,以使用 RHEL 镜像构建器构建镜像。使用自定义软件仓库,您可以配置 Satellite 注册的主机从本地 Satellite 存储库而不是 Red Hat Content Delivery Network (CDN)拉取软件包。

先决条件

  • 您已安装了 RHEL 镜像构建器。请参阅 安装 RHEL 镜像构建器。
  • 运行 RHEL 镜像构建器的主机注册到 Red Hat Satellite,并可访问所需的内容视图。请参阅 将主机注册到 Satellite。
  • 您已下载或找到您的 Satellite 组织用来签署软件包的 GPG 公钥,这通常可通过使用 Satellite 服务器的 Web 界面或 /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release 提供。

流程

  1. 通过登录 Red Hat Satellite Web UI 或检查主机的存储库配置,为您的内容视图查找 Satellite 存储库基本 URL。您需要 BaseOS 和 AppStream URL。

    • BaseOS 存储库 URL 示例

      https://satellite6.example.com/pulp/content/<your_org>/<your_env>/<your_cv>/content/dist/rhel10/10/x86_64/baseos/os
    • AppStream 存储库 URL 示例

      https://satellite6.example.com/pulp/content/<your_org>/<your_env>/<your_cv>/content/dist/rhel10/10/x86_64/appstream/os
  2. 创建自定义存储库目录和配置文件。由于 Satellite 仓库需要 Red Hat Subscription Management (RHSM)证书进行身份验证,所以您必须在自定义存储库配置文件中定义它们,而不是使用命令行标志直接传入。

    1. 创建用于存储存储库覆盖的目录:

      $ mkdir ./repos
    2. 在该目录中创建一个与主机的分发架构匹配的 YAML 文件。该文件必须使用 .yaml 或 .json 扩展名,如 repos/rhel-10.2.yaml :

      x86_64:
       - name: "RHEL 10 BaseOS - Satellite"
         baseurl: "https://satellite6.example.com/pulp/content/<your_org>/<your_env>/<your_cv>/content/dist/rhel10/10/x86_64/baseos/os"
         rhsm: true
         check_gpg: true
         gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
      
       - name: "RHEL 10 AppStream - Satellite"
         baseurl: "https://satellite6.example.com/pulp/content/<your_org>/<your_env>/<your_cv>/content/dist/rhel10/10/x86_64/appstream/os"
         rhsm: true
         check_gpg: true
         gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
  3. 构建镜像,并使用 --force-repo-dir 标志指向包含自定义存储库文件的目录:

    $ image-builder build <image-type> \
    --force-repo-dir=./repos \
    --blueprint <blueprint_name>.toml
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

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

让开源更具包容性

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

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部