container-ops
Skill1 starsChanged 10 months agoMITView on GitHub
Use when the user needs to troubleshoot Docker containers, inspect Kubernetes pods, debug container networking, or analyze container resource usage.
In this repository9 other files it gives its agents.
- disk-cleanupSkill
- incident-triageSkill
- log-analyzerSkill
- network-troubleshooterSkill
- performance-optimizerSkill
- security-auditorSkill
- service-monitorSkill
- ssl-checkerSkill
- system-diagnosticsSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Use whatever is available.
- Distinctive: line 190
NEVER delete containers or images without explicit permission
- Distinctive: line 191
NEVER exec into production containers to modify files
- Distinctive: line 192
ALWAYS check if the user means Docker or Kubernetes when ambiguous
- Very specific: line 194
If kubectl requires auth you don't have, inform the user
- Distinctive: line 195
Read-only operations only.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Container Operations
Overview
Diagnose and troubleshoot containerized applications across Docker and Kubernetes environments. Inspect container state, logs, networking, and resource consumption.
Process
Step 1: Detect Container Runtime
# Check what's available
docker --version 2>/dev/null
podman --version 2>/dev/null
kubectl version --client 2>/dev/null
crictl --version 2>/dev/nullUse whatever is available. Prefer docker for standalone, kubectl for orchestrated.
Step 2: Container Health Overview
Docker:
# All containers with status
docker ps -a --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}\t{{.Image}}"
# Resource usage
docker stats --no-stream --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}"
# Disk usage
docker system dfKubernetes:
# Pod status across namespaces
kubectl get pods --all-namespaces -o wide
# Nodes status
kubectl get nodes -o wide
# Events (recent issues)
kubectl get events --sort-by='.lastTimestamp' | tail -20
# Resource usage (if metrics-server available)
kubectl top pods --all-namespaces 2>/dev/null
kubectl top nodes 2>/dev/nullStep 3: Inspect Problematic Container
Docker - container details:
# Full inspection
docker inspect [container]
# Logs (last 100 lines)
docker logs --tail 100 [container]
# Logs with timestamps (last 30 min)
docker logs --since 30m --timestamps [container]
# Process list inside container
docker top [container]
# Resource limits
docker inspect --format '{{.HostConfig.Memory}} {{.HostConfig.NanoCpus}}' [container]Kubernetes - pod details:
# Pod description (events, conditions)
kubectl describe pod [pod] -n [namespace]
# Logs
kubectl logs [pod] -n [namespace] --tail=100
# Previous container logs (if restarted)
kubectl logs [pod] -n [namespace] --previous
# Multi-container pod
kubectl logs [pod] -n [namespace] -c [container]
# Resource requests/limits
kubectl get pod [pod] -n [namespace] -o jsonpath='{.spec.containers[*].resources}'Step 4: Container Networking
Docker networking:
# List networks
docker network ls
# Inspect network (connected containers, IPs)
docker network inspect [network]
# Container IP and ports
docker inspect --format '{{.NetworkSettings.IPAddress}} {{.NetworkSettings.Ports}}' [container]
# DNS resolution inside container
docker exec [container] nslookup [hostname] 2>/dev/null || docker exec [container] cat /etc/resolv.conf
# Connectivity test from inside
docker exec [container] wget -qO- --timeout=5 [url] 2>&1 || docker exec [container] curl -s --max-time 5 [url]Kubernetes networking:
# Service endpoints
kubectl get svc --all-namespaces
kubectl get endpoints [service] -n [namespace]
# DNS resolution from pod
kubectl exec [pod] -n [namespace] -- nslookup [service]
# Network policies
kubectl get networkpolicies --all-namespaces
# Ingress rules
kubectl get ingress --all-namespacesStep 5: Image and Build Issues
# Image details
docker image inspect [image] | jq '.[0] | {Size, Created, Config: .Config.Cmd}'
# Image layers (find bloat)
docker history [image] --format "table {{.Size}}\t{{.CreatedBy}}" --no-trunc
# Dangling images (wasted space)
docker images -f "dangling=true"
# Unused volumes
docker volume ls -f "dangling=true"Step 6: Common Issues Checklist
| Symptom | Check | Likely Cause |
| Container keeps restarting | docker logs, exit code | App crash, OOM kill |
| Exit code 137 | Memory limits | OOM killed by kernel |
| Exit code 1 | App logs | Application error |
| Can't connect to service | Port mapping, network | Wrong port or network isolation |
| Container won't start | docker inspect, image | Missing image, bad config |
| Slow container | docker stats | Resource limits too low |
| K8s pod Pending | kubectl describe | Insufficient resources, no node match |
| K8s pod CrashLoopBackOff | kubectl logs --previous | App fails on start |
| K8s ImagePullBackOff | kubectl describe | Wrong image name or auth |
Step 7: Present Report
## Container Diagnostics Report
### Environment
- Runtime: [Docker/Podman/K8s]
- Version: [version]
- Total containers: [N running / M total]
### Issues Found
| Container/Pod | Status | Issue | Severity |
|---------------|--------|-------|----------|
| [name] | [status] | [issue] | [CRITICAL/WARNING] |
### Resource Usage
| Container | CPU | Memory | Net I/O |
|-----------|-----|--------|---------|
| [name] | [%] | [used/limit] | [in/out] |
### Root Cause
[Analysis based on findings]
### Recommendations
1. [Action item]
2. [Action item]Rules
- NEVER delete containers or images without explicit permission
- NEVER exec into production containers to modify files
- ALWAYS check if the user means Docker or Kubernetes when ambiguous
- For K8s, always specify namespace to avoid confusion
- If
kubectlrequires auth you don't have, inform the user - Read-only operations only; suggest fixes but don't apply without permission
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.

