agentleFS
PradnyeshpPradnyeshp/Claude-Skills/.claude/skills/dockerize/SKILL.md

dockerize

Skill2 starsChanged 4 months agoMITView on GitHub

Generate a production-ready Dockerfile, .dockerignore, and optional docker-compose for the project, matching its language and build setup. Use when the user says "dockerize this", "write a Dockerfile", "containerize the app", "add docker-compose", or "how do I run this in a container".

3 other projects use a version of this.

Adopted by

Most recently taken up by

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. Very specific:

    Follow security best practices: run as a non-root user, don't bake secrets into layers, copy lockfiles and install deps before copying …

    line 26
  2. Distinctive:

    If an existing Dockerfile is present, read it and propose targeted edits rather than replacing it wholesale.

    line 30
  3. Very specific:

    After writing, print the exact docker build and docker run (or docker compose up) commands to build and run it.

    line 31

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Project type detection

!ls package.json pyproject.toml requirements.txt Cargo.toml go.mod pom.xml build.gradle Gemfile composer.json 2>/dev/null

!ls Dockerfile .dockerignore docker-compose.yml docker-compose.yaml compose.yaml 2>/dev/null && echo "(existing docker files above — update, don't blindly overwrite)"

!cat package.json 2>/dev/null | head -40

Instructions

Generate Docker assets for this project (scoped to $ARGUMENTS if a service or base image was named).

Rules

  1. Detect the stack first. Infer language, runtime version, package manager, build step, and start command from the files above and lockfiles. Match the actual versions in use — don't pin to latest.
  2. Use a multi-stage build for compiled languages and for any project with a build step (install deps + build in one stage, copy only artifacts into a slim runtime stage). This keeps the final image small.
  3. Pick a minimal, pinned base image (e.g. node:22-slim, python:3.12-slim, golang:1.23 → gcr.io/distroless or alpine runtime). State why.
  4. Follow security best practices: run as a non-root user, don't bake secrets into layers, copy lockfiles and install deps before copying source (to maximize layer caching), and use --no-install-recommends / --frozen-lockfile style flags.
  5. Write a matching .dockerignore — exclude node_modules, .git, build output, env files, and local caches so the build context stays small.
  6. Expose the right port and set a sensible CMD/ENTRYPOINT. Add a HEALTHCHECK when the service has an HTTP endpoint.
  7. Generate docker-compose.yml only if the user asks, or the project clearly needs companion services (a database, cache, queue). Wire env vars and volumes; don't invent services that aren't referenced in the code or config.
  8. If an existing Dockerfile is present, read it and propose targeted edits rather than replacing it wholesale.
  9. After writing, print the exact docker build and docker run (or docker compose up) commands to build and run it.

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.