Oracle Linux 10(RHEL 10互換)にPodmanをインストールしてみた

どうも、Tです。

Oracle Linux10にPodmanをインストールした備忘録です。

スポンサーリンク
アドセンス1

環境

Oracle Linux 10

Oracle Linux 10は最小構成でインストールしています。

# cat /etc/redhat-release
Red Hat Enterprise Linux release 10.0 (CentOS Stream)

# uname -a
Linux k-podman.k.local.lab 6.12.0-100.28.2.el10uek.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 19 19:28:24 PDT 2025 x86_64 GNU/Linux

Podman

# podman --version
podman version 5.4.0

事前設定

Oracle Linux 10をインストールした後、下記の設定を行っています。

 Podmanを利用するために必須なわけではなく、私の検証環境の関係によるものです。

SELinux無効化

SELinuxを無効にし、OS再起動で反映します。

# sudo grubby --update-kernel ALL --args selinux=0

# reboot

SELinuxが無効であることを確認します。

# getenforce 
Disabled

Firewalld無効化

Firewalldの自動起動を無効にし、停止します。

 # systemctl disable --now firewalld

Firewalldが停止していることを確認します。

# systemctl status firewalld
○ firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)

Podmanインストール

 互換ではなくRHEL 10を利用の場合は、事前にサブスクリプションにシステム登録してdnfリポジトリを利用できるようにしてください。

Podmanをインストールします。

 # dnf install podman

buildahをインストールします。

 # dnf install buildah
コンテナのビルドなどに利用します。Podmanの利用に必須ではないため必要に応じインストールします。
buildahの詳細は下記を参照ください。
Buildah とは
Buildah は Linux ベースのオープンソースツールで、Open Container Initiative (OCI) 互換コンテナのビルドに使用します。

skopeoをインストールします。

 # dnf install skopeo
 イメージリポジトリの操作などに利用します。Podmanの利用に必須ではないため必要に応じインストールします。
Skopeoの詳細は下記を参照ください。
Skopeo とは?をわかりやすく解説 | Red Hat
Skopeo はコンテナイメージとイメージリポジトリの操作、検査、署名、転送を行う CLI ツール。Podman や Buildah と連携してコンテナのセキュリティや管理操作を行います。

podman-dockerをインストールします。

 # dnf install podman-docker
 dockerコマンドを利用する場合に利用します。Podmanの利用に必須ではないため必要に応じインストールします。

動作確認

podmanの動作確認のためnginxコンテナを作成して、Webサーバーに接続してみます。

podmanはルートレスがウリのため、rootユーザーではなく一般ユーザーで操作していきます。

podman-dockerをインストールしている場合、podmanコマンドの部分はdockerコマンドで実施しても動作します。

下記のコマンドを実行してnginxコンテナイメージをPullして、起動します。

利用するコンテナイメージは、docker.ioを選択しました。

$ podman run -d --name webtest -p 8080:80 nginx
? Please select an image: 
container-registry.oracle.com/nginx:latest
▸ docker.io/library/nginx:latest

nginxコンテナが起動していること(STATUSがUp)を確認します。

$ podman ps -a
CONTAINER ID  IMAGE                           COMMAND               CREATED         STATUS         PORTS                 NAMES
934bdbd72844  docker.io/library/nginx:latest  nginx -g daemon o...  12 seconds ago  Up 12 seconds  0.0.0.0:8080->80/tcp  webtest

PodmanをインストールしたOracle Linux 10のIPアドレスとポート8080を指定してWebブラウザから接続します。

http://192.168.10.207:8080/

Welcomページが表示されることを確認します。

動作確認ができたのでnginxコンテナを停止・削除します。

$ podman ps -a
CONTAINER ID  IMAGE                           COMMAND               CREATED         STATUS         PORTS                 NAMES
934bdbd72844  docker.io/library/nginx:latest  nginx -g daemon o...  12 seconds ago  Up 12 seconds  0.0.0.0:8080->80/tcp  webtest

$ podman stop 934bdbd72844
$ podman rm 934bdbd72844

nginxコンテナイメージを削除します。

$ podman images
REPOSITORY               TAG         IMAGE ID      CREATED     SIZE
docker.io/library/nginx  latest      2cd1d97f893f  9 days ago  196 MB

$ podman rmi docker.io/library/nginx

Appendix

RHEL9以前は、container-toolsをインストールすることでPodman、buildah、skopeoを一括してインストールすることができました。

RHEL10のドキュメントでもcontainer-toolsをインストールするよう記載されています。

コンテナーの構築、実行、および管理 | Red Hat Enterprise Linux | 10 | Red Hat Documentation
コンテナーの構築、実行、および管理 | Red Hat Enterprise Linux | 10 | Red Hat Documentation

4.container-tools メタパッケージをインストールします。

# dnf install container-tools
必要に応じて、podmanbuildahskopeo を個別にインストールすることもできます。

しかし、2025年7月現在、container-toolsのインストールを試すと失敗します。

# dnf install container-tools
メタデータの期限切れの最終確認: 0:11:55 前の 2025年07月24日 09時53分51秒 に実施しました。
引数に一致する結果がありません: container-tools
エラー: 一致するものが見つかりません: container-tools

redditでは、container-toolsがRHEL10では削除されていることが議論されています。

Install container-tools on RHEL for Podman
byu/Agreeable_Repeat_568 inredhat

ドキュメントが誤っているのかわかりませんが、本手順のように個別でインストールすることで同等の構成が行えます。

参考

Getting Started with Podman | Podman
Podman logoPodman logo
コンテナーの構築、実行、および管理 | Red Hat Enterprise Linux | 10 | Red Hat Documentation
コンテナーの構築、実行、および管理 | Red Hat Enterprise Linux | 10 | Red Hat Documentation

まとめ

世の中的にはDockerが多いけど、RHEL互換OS使う僕はPodmanを使うことが多いです。

スポンサーリンク
アドセンス1
アドセンス1
ブログランキング・にほんブログ村へ

シェアする

フォローする