プロジェクト

全般

プロフィール

バグ #329

未完了

Docker-1: 管理基盤・コンテナ一覧 (4h)

Redmine Admin さんが14日前に追加.

ステータス:
新規
優先度:
高め
担当者:
-
開始日:
2025-06-07
期日:
進捗率:

0%

予定工数:

説明

Docker管理の基盤クラスとコンテナ一覧機能を実装する。

実装内容

Docker管理クラス基盤

export class DockerManager {
  private redis: Redis;
  
  constructor() {
    this.redis = new Redis({
      host: 'mcp-redis',
      port: 6379
    });
  }

  async ps(userId: string, host: string, all: boolean = true) {
    const command = all ? 'docker ps -a --format json' : 'docker ps --format json';
    const result = await this.executeDockerCommand(host, command);
    
    return {
      content: [{
        type: "text",
        text: this.formatContainerList(result.stdout)
      }]
    };
  }

  private async executeDockerCommand(host: string, command: string) {
    // SSH経由でDockerコマンド実行
    const ssh = await sshManager.getConnection('system', host);
    return await ssh.execCommand(command);
  }
}

コンテナ一覧機能

  • JSON形式での出力解析
  • コンテナ状態の視覚化
  • フィルタリング機能
  • エラーハンドリング

成果物

  • DockerManager基盤クラス
  • コンテナ一覧機能
  • JSON解析・整形機能

作業時間: 4時間

表示するデータがありません

他の形式にエクスポート: Atom PDF