Docker Managementのロゴ

Docker Management

コミュニティ
AlexAI-MCP
docker-management

Manage Docker containers, images, volumes, networks, and Compose stacks - lifecycle ops, debugging, cleanup, and Dockerfile optimization.

Add to TypingMind

概要

公開者AlexAI-MCP
リポジトリhermes-CCC
スキル名docker-management
スター
134
フォーク
22
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    AlexAI-MCPがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Docker Management」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/AlexAI-MCP/hermes-CCC/tree/master/skills/docker-management
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AlexAI-MCP/hermes-CCC.git /tmp/hermes-CCC
mkdir -p .claude/skills
cp -r /tmp/hermes-CCC/skills/docker-management .claude/skills/docker-management
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでDocker Managementを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にDocker Managementを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Docker Managementは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Docker Management

Purpose

  • Use this skill to run, inspect, debug, and clean up Docker workloads.
  • Prefer it when the task involves containers, images, networks, volumes, or Compose stacks.
  • This skill covers both day-to-day lifecycle operations and practical debugging patterns.

Core Mental Model

  • Images are immutable build artifacts.
  • Containers are running or stopped instances of images.
  • Volumes persist data outside the container filesystem lifecycle.
  • Networks define service-to-service connectivity.
  • Compose describes multi-container applications declaratively.

Container Lifecycle

  • Create and run a container.
  • Start a stopped container.
  • Stop a running container.
  • Restart a container after config or dependency issues.
  • Remove a container when it is no longer needed.

Common Lifecycle Commands

bash
docker run -d --name myapp -p 8080:80 -v ./data:/data myimage
docker start myapp
docker stop myapp
docker restart myapp
docker rm myapp
  • -d runs the container in detached mode.
  • --name assigns a stable container name.
  • -p 8080:80 maps host port 8080 to container port 80.
  • -v ./data:/data mounts a host path into the container.

Run Command Pattern

bash
docker run -d --name myapp -p 8080:80 -v ./data:/data myimage

Use this pattern when you need:

  • background execution
  • a predictable container name
  • host-to-container port mapping
  • local bind-mount persistence

Inspect Running Containers

bash
docker ps
docker ps -a
  • docker ps shows running containers only.
  • docker ps -a shows all containers including exited ones.
  • Exited containers often reveal crash-loop or entrypoint problems.

Exec Into a Container

bash
docker exec -it myapp bash
  • Use this when the container image includes bash.
  • Fall back to sh for slimmer images:
bash
docker exec -it myapp sh

Useful checks inside a container:

  • verify file paths
  • inspect environment variables
  • test network reachability
  • check permissions
  • run the application command manually

View Logs

bash
docker logs -f myapp
  • Use -f to follow logs live.
  • Add --tail 100 to reduce noise when the log is very large.
  • Container logs are the fastest first stop for boot failures.

List Images, Volumes, and Networks

bash
docker images
docker volume ls
docker network ls
  • docker images helps identify build tags and old layers.
  • docker volume ls helps track stateful storage.
  • docker network ls is useful when debugging Compose service communication.

Build Images

bash
docker build -t myapp:latest .
  • Tag images explicitly.
  • Rebuild after Dockerfile changes, dependency changes, or copy-step changes.
  • Keep the build context small with a .dockerignore.

Dockerfile Baseline

dockerfile
FROM python:3.12-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .
CMD ["python", "app.py"]
  • Copy dependency manifests before source code to improve layer caching.
  • Use a narrow base image unless native toolchains are required.

Multi-Stage Dockerfile Pattern

dockerfile
FROM node:22 AS build
WORKDIR /src
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM nginx:alpine
COPY --from=build /src/dist /usr/share/nginx/html
HEALTHCHECK CMD wget -qO- http://localhost/ || exit 1
  • Build dependencies stay in the builder stage.
  • The final stage is smaller and carries less attack surface.
  • Multi-stage builds are standard for frontend artifacts, Go binaries, and compiled assets.

Health Checks

  • Define health checks in the Dockerfile when the service has a meaningful liveness probe.
  • Health checks help Compose and orchestration layers reason about readiness.

Example:

dockerfile
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD curl -fsS http://localhost:8080/health || exit 1
  • Prefer an explicit application health endpoint.
  • Avoid health checks that pass before dependencies are ready unless that is intentional.

Docker Compose Basics

bash
docker compose up -d
docker compose logs
docker compose down
  • docker compose up -d starts the stack in the background.
  • docker compose logs shows service logs across the stack.
  • docker compose down stops and removes the stack's containers and network.

Minimal Compose Example

yaml
services:
  app:
    build: .
    ports:
      - "8080:8080"
    environment:
      APP_ENV: development
    depends_on:
      - redis

  redis:
    image: redis:7-alpine
  • Compose is the default choice for local multi-service development.
  • Keep service names stable because they also become DNS names on the Compose network.

Inspect Container Metadata

bash
docker inspect myapp | jq '.[0].NetworkSettings'
  • Use docker inspect to view full JSON metadata.
  • Pipe through jq to isolate fields that matter.
  • Useful fields include mounts, networks, exposed ports, health status, and entrypoint configuration.

Resource Usage

bash
docker stats
  • This gives a live view of CPU, memory, network I/O, and block I/O.
  • Use it to spot memory leaks, unexpected idle CPU, or runaway workers.

Copy Files In and Out

bash
docker cp file.txt myapp:/app/
docker cp myapp:/app/output.log ./output.log
  • docker cp is useful for hot inspection, artifact extraction, and ad hoc debugging.
  • Prefer rebuilds for durable fixes, but docker cp can unblock investigation quickly.

Cleanup

bash
docker system prune -af
docker volume prune
  • docker system prune -af removes unused containers, networks, dangling images, and build cache aggressively.
  • docker volume prune removes unused volumes.
  • Be careful: pruning can destroy useful cached layers and orphaned but still valuable data.

Common Debugging Patterns

Override the Entrypoint

bash
docker run --rm -it --entrypoint sh myimage
  • Override the entrypoint when the default startup command exits too quickly.
  • This lets you inspect the filesystem and run the target process manually.

Check Environment Variables

bash
docker exec -it myapp env
  • Verify that expected secrets, ports, and mode flags are actually present.
  • Many container bugs reduce to missing or misspelled env vars.

Check the Effective Command

bash
docker inspect myapp | jq '.[0].Config.Entrypoint, .[0].Config.Cmd'
  • This helps distinguish build-time assumptions from runtime reality.
  • It is especially useful when wrapper scripts are involved.

Verify Mounts

bash
docker inspect myapp | jq '.[0].Mounts'
  • Bind-mount mistakes are common in local development.
  • Check source path, destination path, and access mode.

Test Networking

bash
docker exec -it myapp sh -c "wget -qO- http://redis:6379 || true"
  • Test container-to-container DNS and reachability from inside the network namespace.
  • For HTTP services, use curl or wget.
  • For TCP-only services, use the relevant client or a port probe.

Image Hygiene

  • Pin important base images when reproducibility matters.
  • Use slim runtime images where possible.
  • Minimize package-manager caches and temporary files.
  • Copy only what is needed.
  • Keep secrets out of the image entirely.

Security and Reliability Notes

  • Do not bake credentials into Dockerfiles.
  • Avoid running as root when the workload does not require it.
  • Use read-only filesystems or dropped capabilities where appropriate.
  • Scan images regularly with vulnerability tools.

Operational Guidance

  • Prefer Compose for local stacks rather than long hand-written docker run chains.
  • Use docker logs -f first when a service does not start cleanly.
  • Use docker inspect when port mappings or mounts behave unexpectedly.
  • Use health checks for services that depend on internal readiness.
  • Prune deliberately, not reflexively.

Summary

  • Manage container lifecycle with run, start, stop, restart, and rm.
  • Build images with docker build -t myapp:latest ..
  • Debug with docker exec -it myapp bash, docker logs -f myapp, docker inspect, and docker stats.
  • Operate stacks with docker compose up -d, docker compose logs, and docker compose down.
  • Clean carefully with docker system prune -af and docker volume prune.
  • Use multi-stage Dockerfiles and health checks to improve runtime quality and image hygiene.

よくある質問

AIスキル「Docker Management」では何ができますか?

Manage Docker containers, images, volumes, networks, and Compose stacks - lifecycle ops, debugging, cleanup, and Dockerfile optimization.

TypingMindでDocker Managementを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Docker Managementはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにDocker Managementをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/AlexAI-MCP/hermes-CCC/tree/master/skills/docker-managementを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Docker Managementを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Docker Managementで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもDocker Managementを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Docker Management」は無料ですか?

はい。AlexAI-MCPがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇