第 10 章 在构建中使用红帽订阅

按照以下小节中的内容在 OpenShift Container Platform 上运行授权构建。

10.1. 创建 Red Hat Universal Base Image 的 ImageStreamTag

要在构建中使用红帽订阅,您需要创建一个 ImageStream 来引用通用基础镜像 (UBI) 。

直接从 registry.redhat.io 引用 UBI 的构建需要一个 pull secret。

先决条件

  • 您必须为 registry.redhat.io 创建一个 pull secret,并将其链接到用户项目。

流程

  • 在单个项目中创建 imagestreamtag

    $ oc tag --source=docker registry.redhat.io/ubi7/ubi:latest ubi:latest
  • 在 OpenShift Container Platform 命名空间中创建 imagestreamtag 供所有项目中的开发人员使用:

    $ oc tag --source=docker registry.redhat.io/ubi7/ubi:latest ubi:latest -n openshift