コンテンツにスキップ

AlmaLinuxにPodmanをインストールする

AlmaLinuxのアップストリームであるRHEL8から、Dockerコンテナーエンジンと、dockerコマンドが削除されました。代替として、Podmanが標準で用意されています。 PodmanはAppStreamのcontainer-toolsモジュールに含まれています。

sudo dnf module listコマンドを実行すると、container-toolsのストリームリストが確認できます。

Name                 Stream          Profiles Summary
container-tools      rhel8 [d][e]    common [ Most recent (rolling) versions of podman, buildah, skopeo, runc, conmon, runc, conmon, CRIU,
                                     d]        Udica, etc as well as dependencies such as container-selinux built and tested together, and
                                               updated as frequently as every 12 weeks.
container-tools      1.0             common [ Stable versions of podman 1.0, buildah 1.5, skopeo 0.1, runc, conmon, CRIU, Udica, etc as we
                                     d]       ll as dependencies such as container-selinux built and tested together, and supported for 24
                                               months.
container-tools      2.0             common [ Stable versions of podman 1.6, buildah 1.11, skopeo 0.1, runc, conmon, etc as well as depend
                                     d]       encies such as container-selinux built and tested together, and supported as documented on t
                                              he Application Stream lifecycle page.
container-tools      3.0             common [ Stable versions of podman 3.0, buildah 1.19, skopeo 1.2, runc, conmon, etc as well as depend
                                     d]       encies such as container-selinux built and tested together, and supported as documented on t
                                              he Application Stream lifecycle page.

ヒント: [d]efault, [e]nabled, [x]disabled, [i]nstalled

デフォルトではrhel8(ローリング)ストリームが選択されています。 この場合、OSのサポート終了に合わせサポートされるようです。また、1.0~3.0はStableストリームで、公開から2年間のサポートとなるようです。

参考: Container Tools AppStream - Content Availability

インストール

container-toolsモジュールをインストールします。(Podmanの他、Buildah、Skopeo、runcを含みます)

sudo dnf module install -y container-tools dnsmasq
podman -v

コンテナレジストリ設定の確認/変更

podman searchコマンドを使用すると、コンテナーレジストリからコンテナイメージを検索することができます。

以下はmysqlを検索した結果例です(一部省略):

# podman search mysql
INDEX       NAME                                                  DESCRIPTION                                      STARS   OFFICIAL  AUTOMATED
redhat.com  registry.access.redhat.com/rhscl/mysql-57-rhel7       Docker image for running MySQL 5.7 server. T...  0
redhat.com  registry.access.redhat.com/rhscl/mysql-56-rhel7       MySQL 5.6 SQL database server                    0
redhat.com  registry.access.redhat.com/openshift3/mysql-55-rhel7  MySQL 5.5 SQL database server                    0
redhat.com  registry.access.redhat.com/openshift3/mysql-apb       Ansible Playbook Bundle application definiti...  0
redhat.com  registry.access.redhat.com/rhmap46/mysql              Provides an extension to the RHSCL MySQL ima...  0
redhat.com  registry.access.redhat.com/rhmap47/mysql              Provides an extension to the RHSCL MySQL ima...  0
redhat.com  registry.access.redhat.com/rhscl/mysql-80-rhel7       This container image provides a containerize...  0
redhat.io   registry.redhat.io/rhscl/mysql-57-rhel7               Docker image for running MySQL 5.7 server. T...  0
redhat.io   registry.redhat.io/rhscl/mysql-56-rhel7               MySQL 5.6 SQL database server                    0
redhat.io   registry.redhat.io/openshift3/mysql-55-rhel7          MySQL 5.5 SQL database server                    0
redhat.io   registry.redhat.io/openshift3/mysql-apb               Ansible Playbook Bundle application definiti...  0
redhat.io   registry.redhat.io/rhel8/mysql-80                     This container image provides a containerize...  0
redhat.io   registry.redhat.io/rhmap46/mysql                      Provides an extension to the RHSCL MySQL ima...  0
redhat.io   registry.redhat.io/rhmap47/mysql                      Provides an extension to the RHSCL MySQL ima...  0
redhat.io   registry.redhat.io/openshift4/mysql-apb               'Ansible Playbook Bundle application definit...  0
redhat.io   registry.redhat.io/rhscl/mysql-80-rhel7               This container image provides a containerize...  0
docker.io   docker.io/library/mysql                               MySQL is a widely used, open-source relation...  11099   [OK]
docker.io   docker.io/mysql/mysql-server                          Optimized MySQL Server Docker images. Create...  824               [OK]
docker.io   docker.io/library/mariadb                             MariaDB Server is a high performing open sou...  4209    [OK]
docker.io   docker.io/linuxserver/mysql                           A Mysql container, brought to you by LinuxSe...  30

検索対象とするコンテナレジストリはregistries.confファイルで確認できます。rootユーザーで/etc/containers/registries.confを編集し、システムのデフォルト検索設定を変更するか、通常ユーザーとして $HOME/.config/containers/registries.confを作成し、システムのデフォルト検索設定を上書きすることが出来ます。