| name | docker-manager |
| description | Manage Docker containers, images, and compose stacks from your agent. |
Docker Manager
Manage Docker containers, images, and compose stacks from your agent.
Category: dev-tools, automation
API Key Required: No
What It Does
Full Docker management: list containers, start/stop/restart services, view logs, check resource usage, manage images, and deploy compose stacks. Your agent becomes your container ops dashboard.
Setup
Docker must be installed. Check with:
docker --version
docker compose version
If the user needs root-less access:
sudo usermod -aG docker $USER
Agent Commands
List running containers
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}\t{{.Image}}"
List all containers (including stopped)
docker ps -a --format "table {{.Names}}\t{{.Status}}\t{{.Image}}"
Start/stop/restart a container
docker start CONTAINER_NAME
docker stop CONTAINER_NAME
docker restart CONTAINER_NAME
View container logs
docker logs --tail 50 CONTAINER_NAME
docker logs -f --tail 20 CONTAINER_NAME
Container resource usage
docker stats --no-stream --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}"
Inspect a container
docker inspect CONTAINER_NAME | python3 -c "
import json,sys
d = json.load(sys.stdin)[0]
print(f\"Name: {d['Name']}\")
print(f\"Image: {d['Config']['Image']}\")
print(f\"Status: {d['State']['Status']}\")
print(f\"Started: {d['State']['StartedAt']}\")
print(f\"IP: {d['NetworkSettings']['IPAddress']}\")
ports = d['NetworkSettings']['Ports']
for p,bindings in (ports or {}).items():
if bindings:
for b in bindings:
print(f\"Port: {b['HostPort']} -> {p}\")
"
List images
docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}\t{{.CreatedSince}}"
Remove unused images
docker image prune -f
Full system cleanup
docker system prune -f
docker system prune --volumes -f
Disk usage
docker system df
Docker Compose commands
docker compose ls
cd /path/to/project && docker compose up -d
cd /path/to/project && docker compose down
cd /path/to/project && docker compose logs --tail 50
cd /path/to/project && docker compose up -d --build
cd /path/to/project && docker compose pull
Execute command in container
docker exec -it CONTAINER_NAME bash
docker exec -it CONTAINER_NAME sh
Copy files to/from container
docker cp local-file.txt CONTAINER_NAME:/path/in/container/
docker cp CONTAINER_NAME:/path/in/container/file.txt ./local-copy.txt
View container environment variables
docker exec CONTAINER_NAME env | sort
Check container health
docker inspect --format='{{.State.Health.Status}}' CONTAINER_NAME 2>/dev/null || echo "No healthcheck"
Examples
User: "What's running on Docker?"
→ Run docker ps, format as a clean list
User: "Restart the Plex container"
→ docker restart plex
User: "Why is my app crashing?"
→ Check docker logs --tail 100 app-name, look for errors
User: "How much disk is Docker using?"
→ Run docker system df, report totals
User: "Deploy the latest version"
→ docker compose pull && docker compose up -d
Constraints
- User must be in the
docker group or use sudo
- Be careful with
prune commands — they delete things permanently
docker exec requires the container to be running
- Compose v2 uses
docker compose, older v1 uses docker-compose