Docker wait: block until containers stop
Answer: docker wait blocks until one or more containers stop, then prints their exit codes. The alias is docker container wait. If the container has already exited, docker wait returns 0.
Examples
docker wait my_container
docker container wait my_container
Notes
The command stays blocked until the named container exits, then prints the exit code.
Reference list
waitblocks until containers stop and then prints exit codes.Thecommand returns the exit code once the container stops.waitreturns 0 if the container had already exited.
See also
Claims
- id: C1 claim: wait blocks until containers stop and then prints exit codes. source: S1 evidence: "Block until one or more containers stop, then print their exit codes"
- id: C2 claim: The command returns the exit code once the container stops. source: S2 evidence: "The
docker waitcommand above returns the exit code"
- id: C3 claim: wait returns 0 if the container had already exited. source: S2 evidence: "
docker waitreturns0when run against a container which had already"
Sources
- [S1] docker container wait. Docker docs. https://docs.docker.com/reference/cli/docker/container/wait/ . License: Apache-2.0. Accessed 2026-11-18.
- [S2] container wait reference. docker/cli. https://github.com/docker/cli/blob/master/docs/reference/commandline/container_wait.md . License: Apache-2.0. Accessed 2026-11-18.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker docs, docker container wait; docker/cli, container wait reference. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Apache-2.0 (https://raw.githubusercontent.com/docker/cli/master/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker docs, docker container wait; docker/cli, container wait reference. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Apache-2.0 (https://raw.githubusercontent.com/docker/cli/master/LICENSE). Copyright Docker, Inc.
Cite this
iinventedlight. 2026. "Docker wait: block until containers stop." iinventedlight Library, iil:note:xwwz6xe9, version of 2026-11-18. https://iinventedlight.com/library/notes/docker-wait/. License: CC-BY-4.0.
@misc{iil_note_xwwz6xe9,
author = {{iinventedlight}},
title = {{Docker wait: block until containers stop}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-18},
url = {https://iinventedlight.com/library/notes/docker-wait/},
note = {Permanent ID iil:note:xwwz6xe9. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- docker-wait.table.json (table; CC-BY-4.0)
- docker-wait.schema.json (schema; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/docker-wait.md.