4.4. 将 MicroShift 存储库添加到镜像构建器
使用以下步骤将 MicroShift 存储库添加到构建主机上的 Image Builder 中。
先决条件
- 您的构建主机满足 Image Builder 系统要求。
-
已安装并设置 Image Builder 和
composer-cli
工具。 - 有对构建主机的 root 用户访问权限。
流程
运行以下命令,创建一个镜像构建器配置文件,以添加拉取 MicroShift RPM 所需的
rhocp-4.16
RPM 存储库源:cat > rhocp-4.16.toml <<EOF id = "rhocp-4.16" name = "Red Hat OpenShift Container Platform 4.16 for RHEL 9" type = "yum-baseurl" url = "https://cdn.redhat.com/content/dist/layered/rhel9/$(uname -m)/rhocp/4.16/os" check_gpg = true check_ssl = true system = false rhsm = true EOF
运行以下命令,创建镜像构建器配置文件来添加
fast-datapath
RPM 存储库:cat > fast-datapath.toml <<EOF id = "fast-datapath" name = "Fast Datapath for RHEL 9" type = "yum-baseurl" url = "https://cdn.redhat.com/content/dist/layered/rhel9/$(uname -m)/fast-datapath/os" check_gpg = true check_ssl = true system = false rhsm = true EOF
运行以下命令,将源添加到镜像构建器中:
$ sudo composer-cli sources add rhocp-4.16.toml
$ sudo composer-cli sources add fast-datapath.toml
验证
运行以下命令确认源是否已正确添加:
$ sudo composer-cli sources list
输出示例
appstream baseos fast-datapath rhocp-4.16