4.8. 使用 bootc-image-builder 创建 ISO 镜像


您可以使用 bootc-image-builder 创建一个 ISO,您可以从其执行一个可引导容器的离线部署。

先决条件

  • 您已在主机机器上安装了 Podman。
  • 您的主机系统已订阅,或使用绑定挂载注入的存储库配置,以确保镜像构建过程可以获取 RPM。
  • 您有运行 bootc-image-builder 工具的 root 访问权限,并在 --privileged 模式下运行容器,以构建镜像。

流程

  1. 可选:创建一个 config.toml,它会覆盖执行自动安装的默认嵌入式 Kickstart。

    [customizations.installer.kickstart]
    contents = """
    text --non-interactive
    zerombr
    clearpart --all --initlabel --disklabel=gpt
    autopart --noswap --type=lvm
    network --bootproto=dhcp --device=link --activate --onboot=on
    """
    Copy to Clipboard
  2. 运行 bootc-image-builder。如果您不想添加任何配置,请省略 the -v $(pwd)/config.toml:/config.toml 参数。

    $ sudo podman run \
        --rm \
        -it \
        --privileged \
        --pull=newer \
        --security-opt label=type:unconfined_t \
        -v /var/lib/containers/storage:/var/lib/containers/storage \
        -v $(pwd)/config.toml:/config.toml \
        -v $(pwd)/output:/output \
        registry.redhat.io/rhel10/bootc-image-builder:latest \
        --type iso \
        --config /config.toml \
      quay.io/<namespace>/<image>:<tag>
    Copy to Clipboard

    您可以在 output 文件夹中找到 .iso 镜像。

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat