10.4. 使用 Red Hat Satellite 订阅运行构建
10.4.1. 将 Red Hat Satellite 配置添加到构建中 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
使用 Red Hat Satellite 安装内容的构建必须提供适当的配置,以便从 Satellite 存储库获取内容。
先决条件
您必须提供或创建与
yum
兼容的存储库配置文件,该文件将从 Satellite 实例下载内容。仓库配置示例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
流程
创建包含 Satellite 存储库配置文件的
ConfigMap
:oc create configmap yum-repos-d --from-file /path/to/satellite.repo
$ oc create configmap yum-repos-d --from-file /path/to/satellite.repo
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将 Satellite 存储库配置和授权密钥添加为构建卷:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
10.4.2. 使用 Red Hat Satellite 订阅构建 Docker 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Docker 策略构建可以使用 Red Hat Satellite 软件仓库来安装订阅内容。
先决条件
- 您已将授权密钥和 Satellite 存储库配置添加为构建卷。
流程
使用以下示例 Dockerfile 来通过 Satellite 安装内容:
FROM registry.redhat.io/ubi9/ubi:latest RUN dnf search kernel-devel --showduplicates && \ dnf install -y kernel-devel
FROM registry.redhat.io/ubi9/ubi:latest
RUN dnf search kernel-devel --showduplicates && \
dnf install -y kernel-devel