Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

第34章 依存関係ツリーのビルド

34.1. 概要

OpenShift Container Platform uses image change triggers in a BuildConfig to detect when an image stream tag has been updated. You can use the oc adm build-chain command to build a dependency tree that identifies which images would be affected by updating an image in a specified image stream.

The build-chain tool can determine which builds to trigger; it analyzes the output of those builds to determine if they will in turn update another image stream tag. If they do, the tool continues to follow the dependency tree. Lastly, it outputs a graph specifying the image stream tags that would be impacted by an update to the top-level tag. The default output syntax for this tool is set to a human-readable format; the DOT format is also supported.

34.2. 使用法

以下の表は、よく使用される build-chain の使用方法と一般的な構文について説明しています。

表34.1 よく使用される build-chain 操作

説明構文

<image-stream>最新 タグの依存関係ツリーをビルドします。

$ oc adm build-chain <image-stream>

DOT 形式で v2 タグの依存関係ツリーをビルドし、DOT ユーティリティーを使用してこれを可視化します。

$ oc adm build-chain <image-stream>:v2 \
    -o dot \
    | dot -T svg -o deps.svg

test プロジェクトにある指定されたイメージストリームタグについての全プロジェクト間の依存関係ツリーをビルドします。

$ oc adm build-chain <image-stream>:v1 \
    -n test --all
注記

graphviz パッケージをインストールして dot コマンドを使用する必要がある場合があります。