0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Podman で DBGate のコンテナを立てる

0
Posted at

概要

DBGate はデータベース管理ツールです。無償のCommunityライセンスは各OSのインストール版もありますが、コンテナ版も提供されています。今回はこれを Podman + Compose ファイルで起動する手順をまとめます。

compose ファイル

services:
  dbgate:
    image: docker.io/dbgate/dbgate
    container_name: dbgate
    restart: always
    ports:
      - "8080:3000"
    volumes:
      - dbgate-data:/root/.dbgate:Z
volumes:
  dbgate-data:

ポート番号(8080)はサンプルです。環境に応じて適宜変更してください。

起動

podman-compose up -d

ポイント

イメージ名はフルパスで書く

Podman はレジストリの解決を /etc/containers/registries.confunqualified-search-registries 設定に依存します。環境によっては意図しないレジストリからイメージが引っ張られることがあるため、次のようにフルネームで書いておくのが安全です。

image: docker.io/dbgate/dbgate

SELinux ラベル(:Z)が必要な場合がある

RHEL / AlmaLinux などの SELinux 環境で Podman を使う場合、ボリュームマウントに :Z(コンテナ専用ラベル)を付ける必要があります。これがないと SELinux によってボリュームへのアクセスが拒否されることがあります。

volumes:
  - dbgate-data:/root/.dbgate:Z

rootless によるポート制限

Podman はデフォルトで rootless 実行です。80 のような 1024 未満のポートをホスト側で bind する場合、net.ipv4.ip_unprivileged_port_start などのホスト設定次第で権限エラーになることがあります。

動作確認

ブラウザで http://localhost:8080(ホスト名・ポート番号は適宜読み替え)にアクセスし、DBGate の画面が表示されれば起動成功です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?