agentleFS
Cogni-AI-OUCogni-AI-OU/cogni-ai-agent-skills/docker/SKILL.md

docker

Skill4 starsChanged 6 months agoMITView on GitHub

How to run, manage, and troubleshoot Docker containers, images, and networks safely via the command line.

55 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ml-training-recipe, replication and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • getcompanion-aiSkill

    ml-training-recipe

    Find implementable ML training recipes from papers, datasets, docs, and code. Use when the user wants to fine-tune, train, reproduce, or choose a practical ML method, dataset, hyperparameter setup, or benchmark recipe.

    Also in 3 projects that use this

  • getcompanion-aiSkill

    replication

    Plan a replication of a paper, claim, or benchmark, and execute only after an explicit environment choice. Use when the user asks to replicate results, reproduce an experiment, verify a claim empirically, or build a replication package.

    Also in 3 projects that use this

  • Sorcha-PlatformSkill

    scalar

    Generates and configures Scalar OpenAPI UI for API documentation. Use when: Adding API documentation to services, configuring OpenAPI endpoints, customizing documentation themes

    Also in 3 projects that use this

  • brainbytes-devSkill

    alpha-research

    Also in 3 projects that use this

  • JaimeParkerSkill

    paper-code-audit

    Perform three-way cross-validation of a research paper by comparing the original paper text (via Zotero), official code implementation (via Git), and personal Obsidian notes. Use this skill whenever the user wants to "audit a paper", "verify paper claims against code", "cross-check notes with implementation", "triangulate paper + code + notes", "find discrepancies between paper and code", or mentions wanting a deep, structured comparison of a paper's claims against its implementation and their own notes. Also trigger when the user asks to "analyze this paper thoroughly" with code available, or when they want to systematically reconcile what the paper says, what the code does, and what their notes claim.

    Also in 3 projects that use this

  • Sorcha-PlatformSkill

    redis

    Implements Redis caching, session management, and distributed coordination for the Sorcha platform. Use when: Adding caching layers, token revocation, rate limiting, SignalR backplane, or distributed state.

    Also in 5 projects that use this

  • +1 more from getcompanion-ai

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 0 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 47 edited versions we read keep these.

  • 0

    Distinctive

    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
  1. Very specific:

    Non-Interactive Execution: Never use -it or interactive pseudo-TTY modes when executing container commands autonomously.

    line 15
  2. Very specific:

    Resource Cleanup: Always use --rm for ephemeral run commands to prevent container accumulation.

    line 16
  3. Very specific:

    Absolute Paths for Mounts: When binding volumes via -v, strictly use absolute paths ($PWD or full paths) rather than relative paths.

    line 17
  4. Very specific:

    JSON Formatting: When querying for container state or image details, prefer structured output (--format '{{json .}}') for robust parsing.

    line 18
  5. Very specific:

    Debugging Failed Starts: If a container exits immediately, run docker logs <container_name> to trace startup errors.

    line 40
  6. Very specific:

    Network Resolution Issues: If containers cannot reach each other, verify they share a user-defined network using docker network inspect …

    line 42
  7. Very specific:

    Do not: run interactive sessions (docker run -it or docker exec -it).

    line 46

“Common” is measured: kept by at least 6 in 10 of the 47 edited versions of this file we could read. “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

Skill: docker

<!-- markdownlint-disable MD013 MD023 MD031 MD032 -->

Execute, inspect, and manage Docker containers, images, and network components directly via the CLI, adhering to safe operational boundaries.

Core Principles

  • Non-Interactive Execution: Never use -it or interactive pseudo-TTY modes when executing container commands autonomously. Always run in detached (-d) or batch execution modes.
  • Resource Cleanup: Always use --rm for ephemeral run commands to prevent container accumulation. Clean up unused images regularly using docker system prune, and prune unused volumes with docker volume prune or docker system prune --volumes.
  • Absolute Paths for Mounts: When binding volumes via -v, strictly use absolute paths ($PWD or full paths) rather than relative paths.
  • JSON Formatting: When querying for container state or image details, prefer structured output (--format '{{json .}}') for robust parsing.

Commands / Usage Patterns

  • Run Ephemeral Containers: docker run --rm -v "$PWD":/work -w /work <image> <command>
  • Run Detached Services with Port Binding: docker run -d --name <container_name> -p <host_port>:<container_port> <image>
  • Execute Commands in Running Container (Non-Interactive): docker exec <container_name> <command> (Avoid -it for automated agent workflows)
  • Stream Logs with Timestamps: docker logs --timestamps --tail 50 <container_name>
  • Inspect Container Details via JSON: docker inspect --format='{{json .State.Health}}' <container_name>
  • List Running Containers (Structured Output): docker ps --format '{"ID":"{{.ID}}", "Image": "{{.Image}}", "Names":"{{.Names}}", "Status":"{{.Status}}"}'
  • Build Image with Tags: docker build -t <image_name>:<tag> -f <Dockerfile_path> .

Diagnostics and Troubleshooting

  • Debugging Failed Starts: If a container exits immediately, run docker logs <container_name> to trace startup errors.
  • Inspecting Mount Permissions: For permission denied errors inside the container, verify host directory permissions or apply SELinux volume labels (:z or :Z).
  • Network Resolution Issues: If containers cannot reach each other, verify they share a user-defined network using docker network inspect <network_name>.

What to Avoid

  • Do not run interactive sessions (docker run -it or docker exec -it). These will hang automated agents.
  • Do not parse tabular docker ps or docker images output using grep or awk when --format json templating is available.
  • Do not leak credentials via CLI arguments or environment variables (-e PASSWORD=xyz). Use docker secret (Swarm) or mount credential files securely.

Limitations

  • The agent cannot solve authentication steps interactively (e.g., docker login without a password feed).
  • Building massive images may exceed time-to-live execution limits; prefer optimized caching.

Related Skills

  • shell: You MUST load this skill when handling shell commands with performance monitoring or timeouts.
  • dockerfile: You MUST load this skill when writing, reviewing, or optimizing Dockerfiles.

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.