container_wait
Block execution until a Docker container reaches a specified condition: stopped (not-running, next-exit, removed) or healthy. Returns condition met status and exit information without raising errors on timeout.
Instructions
Block until a container reaches a condition: stopped ("not-running"/"next-exit"/"removed") or "healthy".
One contract for every mode: never raises on timeout — the result always carries met (condition
reached) and timed_out. The stop conditions use the daemon's blocking wait and fill status_code/
error (the container's exit info); "healthy" polls the container's HEALTHCHECK every
poll_intervals and fills health/status.
Health semantics: with no HEALTHCHECK defined, once the container is running the tool returns
promptly with health: null and met: false (false = "not confirmed healthy", not "unhealthy" —
check health to tell them apart). A container that exits before becoming healthy returns its
terminal status and met: false.
args: id_or_name - The container id or name until - Condition to wait for: "not-running" (default), "next-exit", "removed", or "healthy" timeout_seconds - Max seconds to wait before returning with timed_out=true (default 600) poll_interval - "healthy" mode only: seconds between re-inspections (default 2, > 0); capped by the time left so a large value can't push the total wait past the timeout returns: dict - {"container", "until", "met", "timed_out", "status_code", "error", "health", "status", "waited_seconds"}; stop modes fill status_code/error, "healthy" fills health ("starting"/"healthy"/"unhealthy", or null with no healthcheck) and status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| until | No | not-running | |
| id_or_name | Yes | ||
| poll_interval | No | ||
| timeout_seconds | No |