agentleFS
jholhewresjholhewres/devclaw-skills/skills/docker/SKILL.md

docker

Skill4 starsChanged 9 months agoMITView on GitHub

Docker management — containers, images, volumes, and networks

  • Reads credentials

We split this skill into the rules it gives an agent

5 rules. 0 are common, 0 are distinctive, and 5 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.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use --rm to auto-remove containers after exit

    line 193
  2. Very specific:

    Use -d for detached (background) mode

    line 194
  3. Very specific:

    Use -p host:container for port mapping

    line 195
  4. Very specific:

    Use --restart unless-stopped for auto-restart

    line 196
  5. Very specific:

    Use docker compose for multi-container apps

    line 197

“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

Docker

Manage Docker containers, images, volumes, and networks.

Containers

# List running containers
docker ps

# List all containers (including stopped)
docker ps -a

# Run container
docker run -d --name myapp -p 8080:80 nginx

# Run with environment variables
docker run -d -e DATABASE_URL=postgres://... -e API_KEY=xxx myimage

# Run with volume
docker run -d -v /host/path:/container/path myimage

# Run interactively
docker run -it ubuntu bash

# Stop container
docker stop myapp

# Start container
docker start myapp

# Remove container
docker rm myapp

# Force remove running container
docker rm -f myapp

Execute in Container

# Execute command
docker exec myapp ls /app

# Interactive shell
docker exec -it myapp bash

# Run as specific user
docker exec -u root myapp command

# Copy files
docker cp file.txt myapp:/app/
docker cp myapp:/app/logs/ ./logs/

Logs & Monitoring

# View logs
docker logs myapp

# Follow logs
docker logs -f myapp

# Last 100 lines
docker logs --tail 100 myapp

# With timestamps
docker logs -t myapp

# Stats (CPU, memory, network)
docker stats myapp

# Inspect container
docker inspect myapp

Images

# List images
docker images

# Pull image
docker pull nginx:latest
docker pull node:18-alpine

# Build image
docker build -t myapp:latest .

# Build with no cache
docker build --no-cache -t myapp:latest .

# Remove image
docker rmi nginx:latest

# Remove dangling images
docker image prune

# Save/load image
docker save myapp:latest | gzip > myapp.tar.gz
docker load < myapp.tar.gz

Docker Compose

# Start services
docker compose up -d

# Build and start
docker compose up -d --build

# Stop services
docker compose down

# View logs
docker compose logs -f

# Scale service
docker compose up -d --scale web=3

# Execute in service
docker compose exec web bash

Volumes

# List volumes
docker volume ls

# Create volume
docker volume create mydata

# Inspect volume
docker volume inspect mydata

# Remove volume
docker volume rm mydata

# Remove unused volumes
docker volume prune

Networks

# List networks
docker network ls

# Create network
docker network create mynet

# Connect container to network
docker network connect mynet myapp

# Disconnect
docker network disconnect mynet myapp

# Remove network
docker network rm mynet

Cleanup

# Remove all stopped containers
docker container prune

# Remove all unused images
docker image prune -a

# Remove everything unused
docker system prune -a

# Show disk usage
docker system df

Tips

  • Use --rm to auto-remove containers after exit
  • Use -d for detached (background) mode
  • Use -p host:container for port mapping
  • Use --restart unless-stopped for auto-restart
  • Use docker compose for multi-container apps

Triggers

docker, container, docker container, docker image, docker compose, run container, docker logs, docker build

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.

Reviews can't be read right now.

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.