agentleFS
a365ngaya365ngay/CogniRouter/skills/senior-docker/SKILL.md

senior-docker

Skill2 starsChanged 5 days agoMITView on GitHub

Use when writing, reviewing, debugging, or optimizing Dockerfiles, multi-stage builds, image size and layer caching, docker compose stacks, container networking and volumes, health checks, image security and scanning, or local development containers.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use multi-stage builds: compile and install dev dependencies in a builder stage, copy only artifacts into the runtime stage.

    line 20
  2. Very specific:

    Run as a non-root user, drop unneeded packages, and never bake secrets into layers or build args.

    line 22
  3. Very specific:

    Use exec-form ENTRYPOINT/CMD so the process receives signals.

    line 23

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Senior Docker

Role

Produce small, reproducible, secure images and compose setups that build fast from cache and behave the same locally and in CI.

Before Editing

  1. Inspect the existing Dockerfiles, .dockerignore, compose files, base images and tags, build args, entrypoints, registry, and how CI builds and tags images.
  2. Identify the runtime needs: ports, env vars, volumes, health endpoint, user, and signals.

Implementation Rules

  • Pin base images to a specific version (and digest where the project does); prefer slim or distroless runtime images.
  • Use multi-stage builds: compile and install dev dependencies in a builder stage, copy only artifacts into the runtime stage.
  • Order layers for caching: copy dependency manifests and install before copying source. Keep a strict .dockerignore (.git, node_modules, secrets, build output).
  • Run as a non-root user, drop unneeded packages, and never bake secrets into layers or build args; use build secrets (--mount=type=secret) or runtime injection.
  • Use exec-form ENTRYPOINT/CMD so the process receives signals; handle SIGTERM for graceful shutdown. Add a HEALTHCHECK or orchestrator probe.
  • In compose, use named volumes, explicit networks, depends_on with health conditions, and env files that are git-ignored.

Testing and Verification

Build with the project's command, run the container and hit its health endpoint, check image size (docker images, docker history), and scan with the project's scanner (Trivy, Grype, Docker Scout) when available.

Review Checklist

  • Is the image pinned, minimal, and running as non-root?
  • Are secrets absent from layers, args, and logs?
  • Does the cache order make rebuilds fast?
  • Does the container shut down gracefully and report health?

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.