Skip to main content

dockerpatterns

Reference for Docker and Docker Compose local dev patterns. USE WHEN writing a Dockerfile or compose file, or containerizing local dev.

ソース情報

リポジトリ
RohiRIK/skills
ソースの最終更新活動
2026年10月15日 06:07
検出された SKILL.md の言語
英語
スター
1
フォーク
1

インストール方法

デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。

ソースファイルを確認

インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。

ファイルエクスプローラー
5 ファイル

SKILL.md を表示中

SKILL.md
ソースの指示 · 読み取り専用プレビュー
name
DockerPatterns
description
Reference for Docker and Docker Compose local dev patterns. USE WHEN writing a Dockerfile or compose file, or containerizing local dev.
category
reference
effort
low
domain
ops
tuned-for
claude-5.5
tuned-on
2026-10-14T00:00:00.000Z
user-invocable
false
# Docker Patterns Docker and Docker Compose best practices for containerized development. ## When to Activate - Setting up Docker Compose for local development - Designing multi-container architectures - Troubleshooting container networking or volume issues - Reviewing Dockerfiles for security and size - Migrating from local dev to containerized workflow ## Reference Load the file matching the task: | Topic | File | |-------|------| | Compose stack, multi-stage Dockerfiles, override files | `Compose.md` | | Service discovery, custom networks, volume strategies | `Networking.md` | | Dockerfile hardening, compose security, secrets, `.dockerignore` | `Security.md` | | Logs, exec, inspect, rebuild, network debugging | `Debugging.md` | ## Anti-Patterns ``` # BAD: Using docker compose in production without orchestration # Use Kubernetes, ECS, or Docker Swarm for production multi-container workloads # BAD: Storing data in containers without volumes # Containers are ephemeral -- all data lost on restart without volumes # BAD: Running as root # Always create and use a non-root user # BAD: Using :latest tag # Pin to specific versions for reproducible builds # BAD: One giant container with all services # Separate concerns: one process per container # BAD: Putting secrets in docker-compose.yml # Use .env files (gitignored) or Docker secrets ``` ## Gotchas - Order Dockerfile layers from least- to most-frequently-changed so the build cache survives code edits; copying source before installing deps busts the cache every build. - Bind-mount source for local dev, but never bake secrets into an image layer — they persist in history even if later removed. ## Examples **Example 1: Local dev compose** ``` User: "set up docker-compose for my app + postgres" → service definitions, volume for db, source bind-mount, healthcheck ``` **Example 2: Slim image** ``` User: "my image is huge" → multi-stage build, layer ordering, .dockerignore ```
GitHubで見る