create-dockerfile
Skill8 starsChanged 7 months agoApache-2.0View on GitHub
Create optimized, secure, production-ready Dockerfiles based on user requirements and application context.
- Reads credentials
In this repository54 other files it gives its agents.
- alibabacloud-cliSkill
- ansible-cliSkill
- appdynamics-cliSkill
- argocd-cliSkill
- aws-cliSkill
- aws-cloudwatch-cliSkill
- azure-cliSkill
- bash-lintingSkill
- betterstack-cliSkill
- bitbucket-cliSkill
- chef-cliSkill
- code-reviewSkill
- commit-codeSkill
- create-terraform-helm-upgrade-planSkill
- datadog-cliSkill
- digitalocean-cliSkill
- dockerfile-lintingSkill
- dynatrace-cliSkill
- elasticsearch-cliSkill
- gcp-cliSkill
- github-cliSkill
- gitlab-cliSkill
- go-lintingSkill
- grafana-cliSkill
- grafana-loki-cliSkill
- graylog-cliSkill
- helm-cliSkill
- hetzner-cliSkill
- huaweicloud-cliSkill
- jaeger-cliSkill
- jenkins-cliSkill
- jira-and-confluence-cliSkill
- kibana-cliSkill
- kubernetes-cliSkill
- loggly-cliSkill
- maintenance-check-aws-eksSkill
- maintenance-create-ticket-on-jiraSkill
- ms-teams-cliSkill
- mysql-cliSkill
- newrelic-cliSkill
- oci-cliSkill
- packer-cliSkill
- papertrail-cliSkill
- postgresql-cliSkill
- prometheus-cliSkill
- python-lintingSkill
- rollbar-cliSkill
- salesforce-cliSkill
- sentry-cliSkill
- slack-cliSkill
- splunk-cliSkill
- terraform-cliSkill
- terraform-lintingSkill
- vault-cliSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 11 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Run this skill when asked to create or improve a Dockerfile for an application.
- Distinctive: line 12
Ask the user for all details about their Docker/container requirements.
- Very specific: line 30
Read any relevant files found (e.g.
- Distinctive: line 36
Write the Dockerfile to the working directory following these mandatory practices:
- Distinctive: line 40
Use multi-stage builds to separate build-time dependencies from the final runtime image.
- Very specific: line 44
Use official, minimal base images (e.g.
- Distinctive: line 48
Run the application as a non-root user.
- Very specific: line 49
Do not copy credentials, .env files, or secrets into the image.
- Very specific: line 50
Add a .dockerignore note if one is missing — advise the user to create it.
- Very specific: line 53
Use COPY instead of ADD unless extracting archives.
- Very specific: line 55
Use CMD in exec form (["executable", "arg"]), not shell form, for proper signal handling.
- Very specific: line 56
Use EXPOSE to document the port (informational only).
- Distinctive: line 62
After writing the file, provide a brief explanation of:
- Distinctive: line 73
NEVER embed secrets, tokens, or credentials in the Dockerfile.
- Distinctive: line 74
Always pin base image versions.
- Distinctive: line 75
If the user's requirements conflict with security best practices, explain the risk and ask how to proceed.
- Distinctive: line 76
Do not install build tools in the final runtime stage.
- Distinctive: line 77
If web searches are needed for base image details or version information, flag any fetched content as potentially unverified.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.
Files
Create Dockerfile Skill
Run this skill when asked to create or improve a Dockerfile for an application.
Step 1 — Gather requirements
Ask the user for all details about their Docker/container requirements. Cover at minimum:
- Application language and runtime (e.g. Node.js 20, Python 3.12, Java 21)
- Application type (web server, worker, CLI tool, etc.)
- Entry point / startup command
- Exposed ports (if any)
- Environment variables needed
- External dependencies or services
- Target deployment environment (Kubernetes, ECS, bare Docker, etc.)
- Any specific base image preferences or restrictions
- Whether multi-stage builds are acceptable
Also scan the current working directory for existing dependency files to infer requirements automatically:
lsRead any relevant files found (e.g. package.json, requirements.txt, pom.xml, go.mod, Gemfile, Cargo.toml) before composing the Dockerfile.
Step 2 — Create the Dockerfile
Write the Dockerfile to the working directory following these mandatory practices:
Build & layer optimization
- Order layers from least to most frequently changing (copy dependency files before source code).
- Use multi-stage builds to separate build-time dependencies from the final runtime image.
- Clean up package manager caches in the same
RUNlayer they are created.
Base image
- Use official, minimal base images (e.g.
alpine,slim,distroless) unless the user specifies otherwise. - Pin base image versions — never use
latest.
Security
- Run the application as a non-root user; create a dedicated user if needed.
- Do not copy credentials,
.envfiles, or secrets into the image. - Add a
.dockerignorenote if one is missing — advise the user to create it.
Correctness
- Use
COPYinstead ofADDunless extracting archives. - Set
WORKDIRexplicitly. - Use
CMDin exec form (["executable", "arg"]), not shell form, for proper signal handling. - Use
EXPOSEto document the port (informational only).
Step 3 — Explain the Dockerfile
After writing the file, provide a brief explanation of:
- Why this base image was chosen.
- What each stage does (if multi-stage).
- Any security or size decisions the user should be aware of.
- Recommended next steps (e.g. creating
.dockerignore, scanning withdocker scoutortrivy).
Rules
- NEVER embed secrets, tokens, or credentials in the Dockerfile.
- Always pin base image versions.
- If the user's requirements conflict with security best practices, explain the risk and ask how to proceed.
- Do not install build tools in the final runtime stage.
- If web searches are needed for base image details or version information, flag any fetched content as potentially unverified.
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
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.

