6.4. コンテナーランタイムの一時的な変更

podman run コマンドに --runtime オプションを指定して使用して、コンテナーのランタイムを変更できます。

注記

<runtime> は crun または runc です。

前提条件

  • containers-tool メタパッケージがインストールされている。

手順

  • registry.access.redhat.com/ubi9/ubi コンテナーイメージをプルします。

    $ podman pull registry.access.redhat.com/ubi9/ubi
    1. --runtime オプションを使用してコンテナーランタイムを変更します。

      $ podman run --name=myubi -dt --runtime=<runtime> ubi9 bashe4654eb4df12ac031f1d0f2657dc4ae6ff8eb0085bf114623b66cc664072e69b
    2. オプション: すべてのイメージをリスト表示します。

      $ podman ps -a
      CONTAINER ID  IMAGE                                   COMMAND  CREATED        STATUS            PORTS   NAMES
      e4654eb4df12  registry.access.redhat.com/ubi9:latest  bash     4 seconds ago  Up 4 seconds ago          myubi

検証

  • OCI ランタイムが myubi コンテナーで <runtime> に設定されていることを確認します。

    $ podman inspect myubi --format "{{.OCIRuntime}}"
    <runtime>