2.5. bootc イメージのバージョンのオーバーライド
Red Hat Enterprise Linux (RHEL) のベースイメージ、Universal Base Images (UBI)、および rhel-bootc は、主要なオペレーティングシステムバージョンのみを追跡するバージョン番号を使用します。派生イメージに対して特定のバージョン番号を定義するには、Containerfile に version ラベルを追加することで、この値をオーバーライドできます。
前提条件
-
container-toolsメタパッケージがインストールされている。
手順
Containerfile を作成します。
FROM registry.redhat.io/rhel10/rhel-bootc:latest # In this example, the custom operating system has its own # version scheme. # The operating system major version is copied # and a sub-version of it is added, which represents a point-in-time # snapshot of the base OS content. # This just changes the output of bootc status. A deeper level # of customization is available by also changing the contents of /usr/lib/os-release. # Define the custom version and release metadata LABEL org.opencontainers.image.version=”10.1.1”現在のディレクトリーの
Containerfileを使用して<image>イメージをビルドします。$ podman build -t quay.io/<namespace>/<image>:<tag> .
検証
オーバーライドが適用されたことを確認します。
$ podman inspect <image-name> --format '{{index .Labels "org.opencontainers.image.version"}}'