3.5. 将 MicroShift 服务添加到蓝图中
将 MicroShift RPM 软件包添加到镜像构建器蓝图中,可以使用嵌入 MicroShift 的 RHEL for Edge 镜像构建。
流程
使用以下示例创建蓝图:
镜像构建器蓝图示例
cat > minimal-microshift.toml <<EOF name = "minimal-microshift" description = "" version = "0.0.1" modules = [] groups = [] [[packages]] name = "microshift" version = "*" [customizations.services] enabled = ["microshift"] EOF
注意命令中的通配符
*
使用最新的 MicroShift RPM。如果您需要特定版本,请替换您想要版本的通配符。例如,插入4.14.1
以下载 MicroShift 4.14.1 RPM。运行以下命令,将蓝图添加到镜像构建器中:
$ sudo composer-cli blueprints push minimal-microshift.toml
验证
运行以下命令,验证 Image Builder 配置只列出 MicroShift 软件包:
$ sudo composer-cli blueprints depsolve minimal-microshift | grep microshift
输出示例
blueprint: minimal-microshift v0.0.1 microshift-greenboot-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.noarch microshift-networking-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.x86_64 microshift-release-info-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.noarch microshift-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.x86_64 microshift-selinux-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.noarch
可选:运行以下命令来验证 Image Builder 配置列出了要安装的所有组件:
$ sudo composer-cli blueprints depsolve minimal-microshift