Skip to content
Agentmart
Submit a tool

write-dockerfile

Writes or updates Dockerfiles and their build contexts.

Skill by cyberphor

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/cyberphor-write-dockerfile

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Writes or updates Dockerfiles and their build contexts. Use when asked to create or update container image builds or runtime packaging.

Use cases: writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/write-dockerfile

What's inside

Skill name
write-dockerfile
Description
Writes or updates Dockerfiles and their build contexts. Use when asked to create or update container image builds or runtime packaging.
License
MIT
Instructions
33 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# How to Write a Dockerfile

Inspect the existing Dockerfile, build context, dependency manifests, image consumers, and runtime requirements before editing. Preserve required entrypoints, ports, architecture support, and artifact paths. Apply changes to the requested image rather than imposing a new deployment workflow.

Read and apply `write-text` from the active skill catalog or [sibling skill](../write-text/SKILL.md) when drafting comments or explanations. Reuse it if already loaded.

## Image Design

Choose a maintained base image compatible with the application's runtime and native dependencies. Preserve the project's tag or digest policy. A smaller image is useful only when it still supplies required libraries, certificates, and runtime files.

Use named multi-stage builds when build tools or intermediate artifacts are unnecessary at runtime. Copy only required outputs into the final stage. Inspect linking requirements before choosing a minimal runtime image.

Put dependency manifests and their installation before frequently changing source files when that preserves correct cache invalidation. Use build cache mounts when useful and supported. Keep `.dockerignore` aligned with the actual context, excluding secrets, local environments, and unnecessary artifacts without excluding required inputs.

## Runtime and Secrets

Prefer a nonroot runtime user when compatible with application permissions and mounted files. Set ownership for required writable paths instead of granting broad permissions. Use exec-form entrypoints and commands when the application should receive process signals directly.

Never put secrets in `ARG`, `ENV`, copied files, or image layers. Use BuildKit secret or SSH mounts for build credentials and the deployment's existing mechanism for runtime secrets. Removing a file in a later layer does not remove it from earlier layers.

## Verification

Build the actual Dockerfile with its intended context, target, and platform. Run a disposable container with representative required configuration and check startup, the relevant command or endpoint, permissions, and shutdown. Keep credentials out of logs. A successful build alone does not verify runtime behavior.

Report the image changes and checks actually completed. If Docker or required dependencies are unavailable, identify the missing runtime checks. Do not push images or change a deployment unless the task authorizes it.

## Official References

* [Docker build best practices](https://docs.docker.com/build/building/best-practices/) for image design, caching, and context exclusions.
* [Multi-stage builds](https://docs.docker.com/build/building/multi-stage/) for stage selection and artifact copying.
* [Build secrets](https://docs.docker.com/build/building/secrets/) for credential mounts.

From cyberphor/skills, MIT.

More from cyberphor/skills

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Oct 17, 2026 (12 days ago)
Last release
Oct 22, 2026 (6 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from cyberphor

Cite this page

write-dockerfile skill. Agent Mart. https://agentmart.dev/skills/cyberphor-write-dockerfile (last updated 2026-10-24)