devopscontainers
Use when: writing or reviewing Dockerfiles, container images, multi-stage builds, layer caching, or image security.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when: writing or reviewing Dockerfiles, container images, multi-stage builds, layer caching, or image security.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when: reviewing .prompt.md, .agent.md, SKILL.md, or .instructions.md files for contradictions, ambiguity, persona consistency, cognitive load, coverage gaps, and composition conflicts.
Use when: checking xanadAssistant workspace health, install status, repair reasons, or lockfile validity before proposing install, update, repair, or restore operations.
Use when: designing or reviewing CI/CD pipelines, GitHub Actions, stage design, environment gates, or artifact discipline.
Use when: writing or reviewing Infrastructure as Code for naming, state management, modularity, and drift detection.
Use when: reviewing DevOps changes for pipeline safety, secret hygiene, permissions, rollback, and deployment risk.
Use when: writing or reviewing API and code documentation, including docstrings, OpenAPI patterns, and parameter tables.
| name | devopsContainers |
| description | Use when: writing or reviewing Dockerfiles, container images, multi-stage builds, layer caching, or image security. |
| type | reference |
| version | 1.0 |
| license | MIT |
Skill metadata: version "1.0"; tags [devops, containers, docker]; recommended tools [].
Use this skill when writing or reviewing Dockerfiles, container compose files, or image-build pipelines.
devopsInfraAsCode or devopsCiCddevopsReview# Stage 1: build
FROM python:3.12-slim AS builder
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
# Stage 2: runtime — minimal image
FROM python:3.12-slim AS runtime
WORKDIR /app
# Run as non-root user
RUN addgroup --system app && adduser --system --ingroup app app
USER app
COPY --from=builder /install /usr/local
COPY --chown=app:app src/ ./src/
EXPOSE 8080
ENTRYPOINT ["python", "-m", "src.main"]
Rules:
COPY not ADD (unless you need tar extraction or URL fetching).ENTRYPOINT + CMD over CMD alone for the main process.Order Dockerfile instructions from least-frequently-changing to most-frequently-changing:
apt-get install)requirements.txt, package.json)Copying source code before installing dependencies defeats caching — every code change triggers a full dependency reinstall.
| Rule | Why |
|---|---|
Pin base image to a digest: python:3.12-slim@sha256:abc123 | Prevents silent upstream changes |
Scan images with docker scout or trivy in CI | Catch known CVEs before deploy |
Do not include .git/, secrets, or IDE config in the image | Use .dockerignore |
Set HEALTHCHECK | Enables orchestrator to detect unhealthy containers |
Do not chmod 777 any directory | Use specific chown for the app user |
Always include a .dockerignore:
.git
.github
*.env
*.env.*
__pycache__
*.pyc
.pytest_cache
node_modules
dist
build
.vscode
| Tag | Use |
|---|---|
:latest | Never in production — it is mutable and unpredictable |
:${GIT_SHA} | Immutable; trace from image to commit |
:v1.2.3 | Semver release tag |
:main | Mutable branch tag; useful for staging |
Build once with the SHA tag, then add the version tag at release time. Never rebuild the image to tag it.
restart: unless-stopped for long-running services.docker-compose.yml — use .env files excluded from git, or a secrets manager.mem_limit, cpus) to prevent runaway containers.:latest.dockerignore excludes .git, *.env, and dev artifacts