跳转到内容
搜索 RHEL 文档

    浏览当前文档目录

    RHEL 10 image mode:bootc CLI 能装,但传统系统不是 bootc 主机

    “装了 bootc 就是 image mode”是常见误解。bootc 只是一个客户端;传统 RHEL 上它能看到自己“不是 bootc 主机”,upgrade 会直接失败。本页把这套边界在 390 上跑出来。

    在 PVE 390 rhel10-lab(RHEL 10.2)执行:

    Terminal window
    sudo dnf -y install bootc
    bootc --version
    sudo bootc status
    sudo bootc upgrade
    bootc install --help

    E3 记录:plans/content-expansion/evidence/rhel/rhel-image-mode/run.json(4 步)。

    $ bootc --version
    bootc 1.16.4
    $ rpm -q bootc
    bootc-1.16.4-2.el10_2.x86_64

    传统主机装完 CLI,bootc status 仍然说“没有镜像”:

    apiVersion: org.containers.bootc/v1
    kind: BootcHost
    metadata:
    name: host
    spec:
    image: null
    bootOrder: default
    status:
    staged: null
    booted: null
    rollback: null
    rollbackQueued: false
    type: null
    usrOverlay: null

    spec.image: null 表示系统不是从 bootc 镜像部署的。

    $ sudo bootc upgrade
    error: Initializing storage: System not booted via bootc

    这不是“没订阅/没网络”,而是启动链不是 bootc:没有 /sysroot 的 bootc 部署元数据。

    $ bootc install --help
    Install the running container to a target.
    Takes a container image and installs it to disk in a bootable format.
    Usage: bootc install <COMMAND>

    bootc install to-disk 可以从 live/容器环境把镜像写到磁盘;本次没有拉取镜像、也没有覆盖任何磁盘。

    要真正进入 image mode,至少需要:

    1. 一个 bootc 格式的容器镜像(含 /usr 等);
    2. 从该镜像部署(bootc install to-disk 或厂商提供的 image mode 镜像);
    3. 系统从该部署启动,bootc status 的 spec.image 非 null;
    4. 之后 bootc upgrade/switch 才有意义。

    只 dnf install bootc 不会转换现有系统。

    • bootc --version 与包版本;
    • bootc status 的 spec.image 是否非 null;
    • 传统系统预期 upgrade 报 “System not booted via bootc”;
    • bootc install 只在空盘/独立 VM 做;
    • 镜像来源、digest、签名已记录。
    • 未拉取/部署 bootc 镜像;
    • 未测试 bootc switch/upgrade 的实际更新;
    • 未测试 image mode 的回滚;
    • 未测试容器存储/签名策略。