dockerfile-generator

dockerfile-generator is a skill for Claude Code from chainguard-demo/claude-plugins. It costs 13 tokens per session (1,107 once invoked), scanned A, original, Apache-2.0.

A guide for creating Dockerfiles with Chainguard Containers, which are container images designed with security in mind.

In plain words
What is it for?
Use it to generate Dockerfiles for applications such as Python, Node.js, Go, Nginx, PostgreSQL, or Redis with Chainguard image references.
Why use it?
It provides rules for choosing base images, separating build and runtime stages, running as a non-root user, and avoiding secrets in the file.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/nonroot/.local.

Part of the chainguard-codegen plugin — 6 skills, 1 MCP server shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add chainguard-demo/claude-plugins
Claude Code
/plugin install chainguard-codegen

Made for: Claude Code.

Or install chainguard-codegen, the plugin that ships this one along with the rest of its 6 skills, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dockerfile-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/chainguard-demo/claude-plugins/dockerfile-generator.svg)](https://agentmods.dev/skills/chainguard-demo/claude-plugins/dockerfile-generator)
Your own site
<a href="https://agentmods.dev/skills/chainguard-demo/claude-plugins/dockerfile-generator"><img src="https://agentmods.dev/badge/skills/chainguard-demo/claude-plugins/dockerfile-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,107 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.01107
Opus 5 $0.00006 $0.00553
Sonnet 5 $0.00003 $0.00221
Haiku 4.5 $0.00001 $0.00111

Measured 6d ago against content hash 0dea91cd32a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

dockerfile-generator scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

RUN apk add --no-cache curl
chainguard-codegen/skills/dockerfile-generator/SKILL.md · 101 lines

How it starts

The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert at creating secure, minimal Dockerfiles using Chainguard Containers. When generating Dockerfiles:

  1. Use Chainguard Containers: Always start with a Chainguard base image from cgr.dev/chainguard/*
  2. Multi-stage builds: Use multi-stage builds to minimize final image size
  3. Non-root user: Ensure the container runs as a non-root user (UID 65532)
  4. Minimal layers: Combine commands to reduce layers
  5. No secrets: Never include secrets in the Dockerfile
  6. Best practices: Follow Docker and Chainguard best practices

Common Chainguard Containers:

  • Python: cgr.dev/chainguard/python:latest or cgr.dev/chainguard/python:latest-dev (includes pip, build tools)
  • Node.js: cgr.dev/chainguard/node:latest or cgr.dev/chainguard/node:latest-dev
  • Go: cgr.dev/chainguard/go:latest (for building) and cgr.dev/chainguard/static:latest (for runtime)
  • Nginx: cgr.dev/chainguard/nginx:latest
  • Postgres: cgr.dev/chainguard/postgres:latest
  • Redis: cgr.dev/chainguard/redis:latest
  • Chainguard base: cgr.dev/chainguard/chainguard-base:latest (general-purpose Linux base, replaces debian/ubuntu/alpine; always use latest, no -dev variant)
  • Wolfi base: cgr.dev/chainguard/wolfi-base:latest (minimal base with apk, for when you need a package manager at runtime)
  • Static: cgr.dev/chainguard/static:latest (distroless, for fully static binaries)

Image Variants:

  • :latest - Production-ready, minimal runtime image (no shell, package manager, or build tools)
  • :latest-dev - Development image with shell, package manager (apk), and build tools
  • -fips - FIPS 140-2 compliant variants for regulated environments (e.g. python-fips, node-fips)

Entrypoints

Chainguard language images use the runtime interpreter as the entrypoint (e.g. python, node, java), not a shell. This means you should use ENTRYPOINT rather than CMD for the application command:

# Correct - python is already the entrypoint, so just pass the script
ENTRYPOINT ["app.py"]

# Also correct
ENTRYPOINT ["python", "app.py"]

# Wrong - results in running "python python app.py"
CMD ["python", "app.py"]

Read the full file on GitHub · 101 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 101 lines · 13 tokens per session scan A 0dea91cd32a0

Subscribe to this mod's changes

dockerfile-generator is a skill published in the GitHub repository chainguard-demo/claude-plugins (7 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 13 tokens to every session and 1,107 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

build-mcpb

This skill should be used when the user wants to "package an MCP server", "bundle an MCP", "make an MCPB", "ship a local MCP server", "distribute a local MCP", discusses ".mcpb files", mentions bundling a Node or Python runtime with their MCP server, or needs an MCP server that interacts with the local filesystem…

anthropics/claude-plugins-official · 98 tokens

opencode-sandbox

Run OpenCode in a docker-dev sandbox (SSH/gh on by default; --no-ssh/--no-github to isolate). Prints docker exec attach; kept until you confirm rm. Don't use for opencode.ai (opencode-runner), Herdr, or the app.

luongnv89/skills · 63 tokens

pentest-cloud-infrastructure

Cloud security posture management and container security assessment for AWS, Azure, GCP, and Kubernetes.

jd-opensource/JoySafeter · 25 tokens

configure-log-aggregation

Set up centralized log aggregation with Loki and Promtail (or ELK stack), including log parsing, label extraction, retention policies, and integration with metrics for correlation. Use when consolidating logs from multiple services into a searchable system, replacing local log files with centralized queryable storage…

pjt222/agent-almanac · 86 tokens

hermes-diagnostic-review

Use when running a read-only diagnostic review of recent Hermes sessions to find recurring mistakes, failed tool calls, and repeated fixes, then propose suggestion-only improvements and reusable skills. Human-gated; never auto-applies.

AtlasOmnia/hermes-custom-pack · 49 tokens

azure-kubernetes-service

Expert knowledge for Azure Kubernetes Service (AKS) development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using AKS Fleet, GPUs, Istio/KEDA/Dapr, KAITO/Ray AI workloads…

MicrosoftDocs/Agent-Skills · 139 tokens