compose_down
Stop and remove containers, networks, and optional named volumes for a Docker Compose project. Use when you need to clean up all resources created by compose up.
Instructions
Stop and remove containers, networks (and optionally volumes) for a compose project.
Inverse of compose_up. Images are kept; named volumes go only with volumes=True
(destructive). Use compose_stop to stop without removing anything.
Does not raise on a non-zero CLI exit (a missing compose plugin or a timeout still raises) - inspect
returncode/stderr in the result.
Args:
project_dir: Dir with the compose file (default: server cwd; copied to the target host if no local plugin)
files: Explicit compose file paths (repeatable, -f)
project_name: Compose project name override
volumes: Also remove named volumes declared by the project (destructive)
remove_orphans: Remove containers not declared in the compose file
timeout_seconds: Subprocess timeout (default 300s)
Returns: dict: {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | ||
| volumes | No | ||
| profiles | No | ||
| project_dir | No | ||
| project_name | No | ||
| remove_orphans | No | ||
| timeout_seconds | No |