stack_deploy
Deploy or update a Docker stack to a swarm from Compose files, with options for detach, prune, registry auth, and image resolution.
Instructions
Deploy (or update) a stack to the swarm from one or more Compose files.
Requires the target daemon to be a swarm manager. Re-running with the same stack_name updates
the stack in place. Defaults to detach=True (returns once specs are submitted, not on
convergence); set detach=False to wait for the rollout (give it a generous timeout_seconds).
args:
stack_name - Name of the stack to create or update
compose_files - One or more Compose file paths (repeated -c; later override earlier). At least one required.
with_registry_auth - Send registry credentials to swarm agents (needed for private images)
prune - Remove services no longer defined in the Compose file
resolve_image - Image-digest resolution: "always" (default), "changed", or "never"
detach - Return immediately after submitting specs (True) vs wait for convergence (False)
cwd - Working directory for resolving relative Compose paths (defaults to the server's cwd)
timeout_seconds - Subprocess timeout (default 1800s)
returns: dict - {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| prune | No | ||
| detach | No | ||
| stack_name | Yes | ||
| compose_files | Yes | ||
| resolve_image | No | ||
| timeout_seconds | No | ||
| with_registry_auth | No |