This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.10.4. Satellite サブスクリプションを使用したビルドの実行
10.4.1. Satellite 設定のビルドへの追加
Satellite を使用してコンテンツをインストールするビルドは、Satellite リポジトリーからコンテンツを取得するための適切な設定を提供する必要があります。
前提条件
Satellite インスタンスからコンテンツをダウンロードするために、yum 互換リポジトリー設定ファイルを提供するか、またはこれを作成する必要があります。
[test-<name>] name=test-<number> baseurl = https://satellite.../content/dist/rhel/server/7/7Server/x86_64/os enabled=1 gpgcheck=0 sslverify=0 sslclientkey = /etc/pki/entitlement/...-key.pem sslclientcert = /etc/pki/entitlement/....pem
[test-<name>] name=test-<number> baseurl = https://satellite.../content/dist/rhel/server/7/7Server/x86_64/os enabled=1 gpgcheck=0 sslverify=0 sslclientkey = /etc/pki/entitlement/...-key.pem sslclientcert = /etc/pki/entitlement/....pem
Copy to Clipboard Copied!
手順
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! Satellite リポジトリー設定を BuildConfig に追加します。
source: configMaps: - configMap: name: yum-repos-d destinationDir: yum.repos.d
source: configMaps: - configMap: name: yum-repos-d destinationDir: yum.repos.d
Copy to Clipboard Copied!
10.4.2. Satellite サブスクリプションを使用した Docker ビルド
Docker ストラテジービルドは、Satellite リポジトリーを使用してサブスクリプションコンテンツをインストールできます。
前提条件
エンタイトルメントキーと Satellite リポジトリー設定がビルド入力として追加される必要があります。
手順
たとえば、Dockerfile を使用して、 Satellite を使用してコンテンツをインストールします。
FROM registry.redhat.io/rhel7:latest USER root # Copy entitlements COPY ./etc-pki-entitlement /etc/pki/entitlement # Copy repository configuration COPY ./yum.repos.d /etc/yum.repos.d # Delete /etc/rhsm-host to use entitlements from the build container RUN rm /etc/rhsm-host && \ # yum repository info provided by Satellite yum -y update && \ yum -y install <rpms> && \ # Remove entitlements rm -rf /etc/pki/entitlement # OpenShift requires images to run as non-root by default USER 1001 ENTRYPOINT ["/bin/bash"]
FROM registry.redhat.io/rhel7:latest
USER root
# Copy entitlements
COPY ./etc-pki-entitlement /etc/pki/entitlement
# Copy repository configuration
COPY ./yum.repos.d /etc/yum.repos.d
# Delete /etc/rhsm-host to use entitlements from the build container
RUN rm /etc/rhsm-host && \
# yum repository info provided by Satellite
yum -y update && \
yum -y install <rpms> && \
# Remove entitlements
rm -rf /etc/pki/entitlement
# OpenShift requires images to run as non-root by default
USER 1001
ENTRYPOINT ["/bin/bash"]