Dockerfile Builder skill for Claude and Codex
A small, secure, cache-friendly Dockerfile for your language and package manager, with the dependency and user choices explained in comments.
Install it once and Claude or Codex runs it for you. When your request matches, your AI loads the skill, asks for anything it is missing, and works through the template itself. Prefer to fill it in by hand? See the full prompt template.
Download the skill (.zip) · View SKILL.md
When it is used
Use when a developer needs a new Dockerfile for a Node, Python, Go, Rust, Java, or Ruby service that does not have one yet. Do not use for reviewing or shrinking an existing Dockerfile or Kubernetes manifests. Related topics: devops, coding, docker.
What it will ask you for
- Language and framework (choose one: Node.js, Python with Flask, Python with Django, Go, Rust, Java, Ruby on Rails)
- Package manager (choose one: npm, yarn, pip, go mod, cargo, maven)
- Application port (number from 1 to 65535)
- Multi-stage build (choose one: Yes, No)
- Base OS preference (choose one: Alpine, Debian slim, Ubuntu, Default for the language)
- System dependencies (longer free text)
- Optimisations (choose any: Run as non-root user, Cache dependencies, Set environment variables)
How it works
- Choose a pinned base image for the language and the OS preference, and note any musl risk.
- Order the layers so the dependency manifest is copied and installed before the source.
- Apply the multi-stage, non-root, and environment choices, done when the final stage holds only runtime files.
- Install system dependencies in one cleaned layer and write the matching .dockerignore.
- Give the build and run commands with the exposed port.
What you get
A commented Dockerfile, a .dockerignore, and the build and run commands.
What it watches out for
- Copying all source before installing dependencies, which rebuilds them on every code change.
- Choosing Alpine for an app with native libraries that expect glibc.
- Leaving the container running as root with build tools in the final image.
How to install
Claude.ai and the Claude desktop app
- Download the skill .zip.
- Open Settings, then Capabilities, and find Skills.
- Choose Upload skill and select the .zip.
- Ask Claude for help with the task. It loads the skill when your request matches.
Claude Code
- Download the skill .zip.
- Unzip it into ~/.claude/skills/ (or .claude/skills/ inside a project).
- Start a new session. Claude Code loads the skill when your request matches.
Codex
- Download the skill .zip.
- Unzip it into ~/.agents/skills/ (or .agents/skills/ inside a project).
- Codex picks it up on its own. Type $ and the skill name to use it, or just ask for the task.
Cursor
- Download the Cursor rule (.mdc).
- Save it in .cursor/rules/ inside your project.
- Cursor's agent applies the rule when your request matches its description.
AGENTS.md (Codex, Cursor, and other coding agents)
- Copy the AGENTS.md section.
- Paste it into AGENTS.md at the root of your repository, creating the file if needed.
- Coding agents that read AGENTS.md follow it when your request fits.