Podman

Table of Contents

container-tools 3.0のインストール手順

有効になっているバージョン確認

# 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, Udica, etc as well as dependencies such as container-selinux built and tested together, and updated as fre
                             d] [i]   quently 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 well as dependencies such as container-selinux built and tested together, and supported for 24 months.
                             d]
container-tools 2.0          common [ Stable versions of podman 1.6, buildah 1.11, skopeo 0.1, runc, conmon, etc as well as dependencies such as container-selinux built and tested together, and supported as documented on the Application
                             d]       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 dependencies such as container-selinux built and tested together, and supported as documented on the Application
                             d]       Stream lifecycle page.

Stream切り替え

# dnf module enable container-tools:3.0

インストール

# dnf module install container-tools:3.0

インストール済みの時は、「reset」または、[remove]でアンインストール後にインストールを行なう

# dnf module reset container-tools
または、
# dnf module remove container-tools

コマンド

  • イメージを取得
    # podman pull docker.io/library/redmine:4.2.4
  • イメージの一覧
    # podman images
  • イメージの基本情報を確認
    # podman inspect docker.io/library/redmine:4.2.4
  • イメージの一括削除
    # podman rmi --all
  • ボリューム作成(DBの永続化に使用するフォルダ指定)
    # mkdir /usr/local/redmine
    # cd /usr/local/redmine
    # mkdir -p /usr/local/redmine/data/db
    # podman volume create -o type=none -o device=/usr/local/redmine/data/db -o o=bind datastore
  • ボリュームの一覧
    # podman volume ls
  • ボリュームを一括削除
    # podman volume rm --all
  • Pod を作成
    # podman pod create -p 3000:3000 --name redmine-pod
  • Pod を作成(ファイル共有版)
    # mkdir /usr/local/redmine
    # cd /usr/local/redmine
    # mkdir -p /usr/local/redmine/data/conf/mysql/conf.d
    # vi /usr/local/redmine/data/conf/mysql/conf.d/multibyte.cnf
    -----------------------------------------------
    [mysqld]
    character-set-server=utf8mb4
    collation-server=utf8mb4_general_ci
    -----------------------------------------------
    # podman run --name=redmine-db -d --pod redmine-pod \
    --env='MYSQL_DATABASE=redmine' \
    --env='MYSQL_ROOT_PASSWORD=redmine' \
    --env='MYSQL_USER=hoge' \
    --env='MYSQL_PASSWORD=(パスワード)' \
    -v datastore:/var/lib/mysql \
    -v /usr/local/redmine/data/conf/mysql/conf.d:/etc/mysql/conf.d \
    docker.io/library/mariadb
  • Pod を作成(コマンド直接指定版)
    podman run --name=redmine-db -d --pod redmine-pod \
    --env='MYSQL_DATABASE=redmine' \
    --env='MYSQL_ROOT_PASSWORD=redmine' \
    --env='MYSQL_USER=hoge' \
    --env='MYSQL_PASSWORD=(パスワード)' \
    -v datastore:/var/lib/mysql \
    docker.io/library/mariadb  --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
  • podの一覧
    # podman pod ls
  • LOGを確認
    # podman logs redmine-db
  • コンテナの中でbash起動
    # podman exec -it redmine bash
  • コンテナからホストにコピー
    # podman cp redmine-db:/tmp/database.sql database.sql
  • コンテナの一覧
    # podman ps
  • ポッドを全て終了する場合
    # podman pod stop --all
  • ポッドを全て削除
    # podman pod rm --all
  • ポッドの起動
    podman play kube ./redmine-pod.yaml

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です