docker-packaging
Skill3 starsChanged 7 days agoMITView on GitHub
Use when designing or packaging a self-hosted service or Docker image. One small dockerizable app, existing tagged images over new Dockerfiles, Docker only where it validates something.
- Reads credentials
In this repository12 other files it gives its agents.
- adversarial-reviewSkill
- agent-workdirSkill
- airgapSkill
- db-migrationsSkill
- delegateSkill
- handoffSkill
- impeccableSkill
- run-validationSkill
- security-huntSkill
- ship-auditSkill
- skill-critiqueSkill
- web-perimeter-auditSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
Start from a small, maintained base and apply the tag rule above to every FROM and Compose image:.
- Very specific: line 35
Run non-root unless the service needs a specific privilege.
- Distinctive: line 44
Document required environment variables, listening address, and port.
- Distinctive: line 46
Put persistent data on named volumes and ensure the container user can write to them.
- Very specific: line 47
Add a healthcheck that tests actual readiness.
- Distinctive: line 60
Wait for health, hit the real endpoint, and perform one meaningful operation.
- Distinctive: line 63
Stop the service and inspect logs for startup, permission, and shutdown errors.
- Very specific: line 69
Document build/run commands, configuration and secret inputs, persistent-data paths, the update procedure, and how to return to the …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Docker packaging
- Design for self-hosting: one small dockerizable app beats a sprawl of small services.
- Online dependencies (CDNs, fonts, APIs, package registries) are fine unless the user says the
target is offline. Then also follow the
airgapskill. - Package and run self-hosted services with Docker. Look for an existing official or
well-maintained tagged image before writing a Dockerfile. Use a version tag at the level the app
needs (
postgres:16,node:22), neverlatest. Add a digest (name:tag@sha256:…) only where one exact build matters, such as a release image you must be able to roll back to. - Ordinary local development and tests don't need Docker when host-local commands validate them
faithfully (see
run-validation).
Package the service
Inspect existing Dockerfiles, Compose files, CI, and deployment docs first. Reuse working project conventions; don't rewrite working packaging for style. Add only what the service needs:
- A
Dockerfilewhen no suitable maintained image can run the app. - A
.dockerignorefor every build context. - A
compose.yamlwhen it captures runtime configuration or service dependencies more clearly than adocker runcommand. - An
.env.examplewith safe placeholders and concise build, run, and configuration docs.
For a new Dockerfile:
- Start from a small, maintained base and apply the tag rule above to every
FROMand Composeimage:. - Install from the project's lockfile. Use multi-stage builds when build tools or development dependencies should not ship in the runtime image.
- Run non-root unless the service needs a specific privilege. Use an exec-form
ENTRYPOINT/CMDand make sure the application receives stop signals. - Exclude VCS metadata,
.env, secrets, caches, local dependency directories, and build output; copy only the files the build or runtime needs. - Supply runtime secrets through the app's environment, file, or mounted-secret mechanism. For
build-time credentials, use
RUN --mount=type=secret; never useARG,ENV, orCOPYfor them.
Make the runtime explicit
- Document required environment variables, listening address, and port. Validate required configuration at startup and fail with a useful error.
- Put persistent data on named volumes and ensure the container user can write to them.
- Add a healthcheck that tests actual readiness. Use
depends_onwithcondition: service_healthywhen one service needs another to be ready. - Publish only the intended entrypoint; keep databases and other internal service ports off the host unless requested.
- Set a restart policy for long-running services unless the project already has another policy.
Prove the package
Choose the environment with run-validation, then:
- Validate Compose configuration with
docker compose config -q, when present. - Build the actual image and start a clean stack. Use a fresh Compose project or disposable test resources for isolation; never delete existing data to make a test clean.
- Wait for health, hit the real endpoint, and perform one meaningful operation. A running container or successful config parse alone is not proof.
- For stateful services, recreate the app container and verify that the data survives.
- Stop the service and inspect logs for startup, permission, and shutdown errors.
- Report the image reference and platform actually tested, plus anything left unverified. Remove only test resources you created.
Handoff
Document build/run commands, configuration and secret inputs, persistent-data paths, the update
procedure, and how to return to the previous image tag or digest. Use ship-audit for release
readiness and db-migrations for schema changes; a packaging smoke test is not a production audit.
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.

