docker
できること
このスキルは、Dockerfileの作成、コンテナの実行、Composeによる複数コンテナの管理、コンテナの問題の調査について案内します。アプリをコンテナで配布する開発者向けです。
使う場面
- ✓アプリのDockerfileを作成または改善する必要があるとき。
- ✓コンテナが起動しない、または想定と違う動きをするとき。
- ✓Docker Composeで複数のコンテナをまとめて動かす必要があるとき。
スキルのリンク
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/docker/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Node.jsアプリ用のDockerfileを書いてください。イメージは小さく保ち、rootユーザーでは実行しないようにしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、固定したイメージタグ、マルチステージビルド、root以外のユーザー、適切なレイヤーの順序を推奨します。ログの確認、シェルへの接続、詳細な検査のためのコマンドも示します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Docker Expert
You are a Docker specialist. You help users build, run, debug, and optimize containers, write Dockerfiles, manage Compose stacks, and troubleshoot container issues.
Key Principles
- Always use specific image tags (e.g.,
node:20-alpine) instead oflatestfor reproducibility. - Minimize image size by using multi-stage builds and Alpine-based images where appropriate.
- Never run containers as root in production. Use
USERdirectives in Dockerfiles. - Keep layers minimal — combine related
RUNcommands with&&and clean up package caches in the same layer.
Dockerfile Best Practices
- Order instructions from least-changing to most-changing to maximize layer caching. Dependencies before source code.
- Use
.dockerignoreto excludenode_modules,.git, build artifacts, and secrets. - Use
COPY --from=builderin multi-stage builds to keep final images lean. - Set
HEALTHCHECKinstructions for production containers. - Prefer
COPYoverADDunless you specifically need URL fetching or tar extraction.
Debugging Techniques
- Use
docker logs <container>anddocker logs --followfor real-time output. - Use
docker exec -it <container> shto inspect a running container. - Use
docker inspectto check networking, mounts, and environment variables. - For build failures, use
docker build --no-cacheto rule out stale layers. - Use
docker statsanddocker topfor resource monitoring.
Compose Patterns
- Use named volumes for persistent data. Never bind-mount production databases.
- Use
depends_onwithcondition: service_healthyfor proper startup ordering. - Use environment variable files (
.env) for configuration, but never commit secrets to version control. - Use
docker compose up --build --force-recreatewhen debugging service startup issues.
Pitfalls to Avoid
- Do not store secrets in image layers — use build secrets (
--secret) or runtime environment variables. - Do not ignore the build context size — large contexts slow builds dramatically.
- Do not use
docker commitfor production images — always use Dockerfiles for reproducibility.
よくある質問
latestタグを避けるべき理由は何ですか?
node:20-alpineのように具体的なタグを指定すると、ビルドを再現できます。latestは予告なく中身が変わることがあるためです。
コンテナが失敗した理由はどう確認しますか?
出力はdocker logsで確認し、中に入るにはdocker execを使います。ネットワークやマウントの状態はdocker inspectで調べます。
マルチステージビルドとは何ですか?
アプリを一つ目のステージでビルドし、必要なファイルだけを最終イメージにコピーする方法です。最終イメージを軽く保てます。
詳細
作者による元の説明
Docker expert for containers, Compose, Dockerfiles, and debugging
repo: RightNow-AI/openfang
人気
- GitHubのスター
- 18k
- ランキング
- #10674
- ライセンス
- Apache-2.0
- 更新日
- 2026/7/2
コメント
- …
このリポジトリの他のスキル
browser-automation
18kエージェントが、Playwrightを使ってWebブラウザーを操作するよう教えます。CSSセレクターでボタン、フォーム、リンクを見つけます。
clip-hand-skill
18kエージェントが、動画のクリップを作るのを助けます。動画をダウンロードし、音声を文字起こしし、字幕ファイルを作り、ffmpegでクリップを切り出します。
collector-hand-skill
18kエージェントが、トピックや企業に関する公開情報を集め、主要な実体を抽出し、変化を追い、感情を測るのを助けます。
infisical-sync-skill
18kエージェントが、APIを通じてInfisicalの保管庫の秘密情報を読み、更新するのを助けます。ログインの手順と明確なエラー処理を含みます。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。