agentleFS
yuanJewelyuanJewel/skills/docker-local-environment/SKILL.md

docker-local-environment

Skill2 starsChanged 22 days agoMITView on GitHub

Set up, diagnose or clean up local Docker/Compose environments for development and testing, managing dependency readiness, resources and parallel isolation. Production operations, remote Docker endpoints and release decisions are out of scope for this package.

We split this skill into the rules it gives an agent

18 rules. About 0 are common, 15 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No local engine evidence, or the endpoint is remote/of unknown identity -> stop engine operations, deliver only the candidate and gaps.

    line 24
  2. Distinctive:

    Create or add parallel nodes: read Isolation and resources and fill in the environment manifest first.

    line 31
  3. Distinctive:

    Configure, start and reset: read Compose and readiness.

    line 32
  4. Distinctive:

    Locate failures: read the diagnostic tree; pin the failing node and minimal observation.

    line 34
  5. Distinctive:

    Do: verify the effective Docker endpoint and the source of the context.

    line 40
  6. Distinctive:

    Stop condition: remote or unknown identity -> stop engine operations.

    line 41
  7. Very specific:

    Do: pin the candidate Compose files, explicit file set, image identity, synthetic configuration, directories/networks/volumes/ports and …

    line 44
  8. Distinctive:

    Stop condition: on finding someone else's resources, do not take them over.

    line 45
  9. Distinctive:

    Do: resolve the configuration first, then start dependency by dependency.

    line 48
  10. Distinctive:

    Stop condition: image not local and pull/build outside the task's permitted scope -> stop and report the acquisition gap.

    line 49
  11. Distinctive:

    Do: use bounded probes to wait for this version, seed and the real call chain to be ready.

    line 52
  12. Distinctive:

    Stop condition: stop on timeout, keep state and minimal logs, and distinguish service errors from environment errors.

    line 53
  13. Distinctive:

    Do: confirm the second node's ports, files, persistent state and stubs are independent, and test that they do not contaminate each other.

    line 56
  14. Distinctive:

    Stop condition: isolation not proven -> do not sign off parallel use.

    line 57
  15. Very specific:

    Do: record start/reset/cleanup entry points, actual readiness evidence, versions and capabilities not simulated.

    line 60
  16. Distinctive:

    Stop condition: after abnormal termination, first verify in-flight processes and resource ownership.

    line 61
  17. Distinctive:

    When seeding fails, health must be not-ready.

    line 68
  18. Very specific:

    Read the execution configuration and node budget the project provides.

    line 83

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Local container environment

Deliver a local environment that starts repeatably, explains its failures and has a bounded cleanup scope. An image that starts does not prove the business is ready.

Inputs

  • Workspace and permitted operations
  • Service dependency graph
  • Image identity and CPU architecture
  • Resource budget and node ownership
  • Configuration interfaces and synthetic data
  • Expected readiness conditions

Missing branches:

  • Budget or ownership missing -> block only startup; configuration can still be prepared.
  • No local engine evidence, or the endpoint is remote/of unknown identity -> stop engine operations, deliver only the candidate and gaps; do not switch context automatically.
  • Local image missing -> report the acquisition gap; pull or build only within the task's permitted scope, and do not run upstream install scripts.
  • Readiness conditions missing -> do not sign off readiness; report only the observed layers (running, port, HTTP).
  • Environment manifest missing -> do no cleanup, no global prune, and do not guess ownership from name prefixes.

Choose the current path

  • Create or add parallel nodes: read Isolation and resources and fill in the environment manifest first.
  • Configure, start and reset: read Compose and readiness. The synthetic Compose file is a single-service example using a verified local image and a dedicated loopback port; it cannot replace the project dependency graph. Services attached only to an internal network get no host port mapping; the example attaches services needing host access to a separate non-internal publish network, while dependency services stay on the internal network only.
  • Locate failures: read the diagnostic tree; pin the failing node and minimal observation; do not rebuild the whole environment by default.
  • Finish and clean up: per the manifest, verify actual resource identities, writers and evidence to keep, then delete the objects owned this time and approved for cleanup.

Execution order and stop points

  1. Verify the engine
    • Do: verify the effective Docker endpoint and the source of the context; check explicit command flags and environment overrides, not just the default context name.
    • Stop condition: remote or unknown identity -> stop engine operations; do not switch context automatically.
    • Artefact: local engine evidence.
  2. Pin inputs and resources
    • Do: pin the candidate Compose files, explicit file set, image identity, synthetic configuration, directories/networks/volumes/ports and budget; check for existing resources with the same names.
    • Stop condition: on finding someone else's resources, do not take them over; continue only after switching to this run's own names.
    • Artefact: planned resources in the environment manifest.
  3. Resolve and start
    • Do: resolve the configuration first, then start dependency by dependency. Configuration expansion may display values; handle only explicitly synthetic inputs.
    • Stop condition: image not local and pull/build outside the task's permitted scope -> stop and report the acquisition gap.
    • Artefact: rendered configuration summary and actual image identity.
  4. Wait for readiness
    • Do: use bounded probes to wait for this version, seed and the real call chain to be ready.
    • Stop condition: stop on timeout, keep state and minimal logs, and distinguish service errors from environment errors; do not extend waits to mask failure.
    • Artefact: readiness evidence or the first failure.
  5. Verify parallel isolation
    • Do: confirm the second node's ports, files, persistent state and stubs are independent, and test that they do not contaminate each other. AI concurrency and environment node count are two different budgets; do not convert one into the other.
    • Stop condition: isolation not proven -> do not sign off parallel use.
    • Artefact: two-node isolation evidence.
  6. Record and close
    • Do: record start/reset/cleanup entry points, actual readiness evidence, versions and capabilities not simulated.
    • Stop condition: after abnormal termination, first verify in-flight processes and resource ownership; do not start another node with the same name until that is clear.
    • Artefact: completed environment manifest.

Criteria, counter-examples and resources

Normal path: two nodes each write their own synthetic seed and each read back their own identifier; cleaning up one does not affect the other. Adjacent misuse: a local reproduction request that points at a remote context should deliver only the candidate and gaps; on finding a port in use, do not kill the occupant. When seeding fails, health must be not-ready. When a volume directory is not writable, do not solve it by loosening permissions on the whole host directory.

ScenarioExpectedEvidence location
First start readyInternal healthcheck reads the expected content, and the host loopback probe passes separatelyManifest dependency table; Compose and readiness
Dependency or seed not readyHealth stays not-ready; a 200 degraded page does not count as whole-system readyFailure/recovery column of the manifest dependency table
Port conflictOn bind failure switch this node's port; do not kill the occupant; with empty docker port output do not sign off the conflict checkManifest port row; Isolation and resources
Two nodes in parallelEach writes and reads its own identifier; after cleaning up one, the other can still readManifest "two-node isolation" item
Resource limit exceeded/OOMStop new load from this task; record as an environment failure, not a business assertion failureManifest budget and measurement items; diagnostic tree
Old data remains after resetReset only dedicated resources you are entitled to; do not delete similar volumesManifest volume row; diagnostic tree
Image platform mismatchSwitch to the matching architecture image or record emulation; do not call it equivalent to nativeManifest image item; diagnostic tree
Points at a remote contextStop engine operations; deliver only the candidate and gapsManifest local engine evidence item
Bounded cleanupDelete only manifest objects owned this time; on failure report remaining IDs; do not escalate to global pruneManifest closing item; "Bounded cleanup" in Isolation and resources

Resource guidance: configuration rendering/known probes use low/low; topology and recovery design use normal/medium; mount, concurrency or readiness-semantics conflicts use normal/high. Grade words map to actual execution configuration through the project resource mapping. Read the execution configuration and node budget the project provides; on exceeding resources, first stop this run's new load and preserve evidence; do not squeeze unrelated services. Re-verify affected paths when the image/Compose/host changes; Linux containers cannot prove native macOS/Windows behaviour. Local health or a passing CI build does not mean releasable.

Closing cleanup: containers, Compose projects, networks and volumes created this time, plus untagged images and temporary builders left by builds, are cleaned up on finishing or abandoning. Follow the local resource cleanup rules of task-implementation: register identities at creation, at closing clean up only the objects registered this time, write evidence to keep and cleanup failures into the receipt, and use no global cleanup commands.

Sources

  1. Pinned source: EC09 docker-patterns.
  2. Referenced networks, volumes, loopback ports, readiness and container limits; the resource manifest, ownership, node isolation and diagnostic method are own-authored for this package. Dropped plugin installation, real credential injection, global prune and production commands.
  3. License: shipped with the package as LICENSE-EC.txt (EC, MIT); library-wide third-party summary in the root THIRD_PARTY_NOTICES.md. Copy the license file along when copying this package alone.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.