SIGN IN SIGN UP

Add support for container wait conditions (#2487)

Expose the `condition` query parameter (added in Docker Engine API v1.30) on `WaitContainerCmd`. When the parameter is omitted, we keep the daemon’s default `not-running` behaviour.

Practical implications
----------------------
* **create → wait (no condition) → start**
  Calling `wait` right after `create` but **before** `start` returns immediately with whatever exit-code the daemon reports for a container that has never run (typically `0`). In other words, you learn nothing about the future process.

* **create → start → wait (no condition)**
  For short-lived containers started with `--rm`, the container may be auto-removed before the client manages to issue `wait`, resulting in a *"container not found"* error.

* **create → wait(condition=removed) → start**
  Passing the new `removed` condition eliminates both races: the wait call blocks until the container has exited *and* been removed, reliably yielding the actual exit code even for `--rm` containers.
A
Alexander Koshevoy committed
dfe1866d956f64fd4b91834f9b09ee973ac1f270
Parent: 9165f41
Committed by GitHub <noreply@github.com> on 8/19/2025, 9:53:58 PM