docker container prune: remove all stopped containers
Answer: docker container prune will remove all stopped containers. --force means do not prompt for confirmation. --filter can use until=<timestamp>.
What gets removed
This will remove all stopped containers.
Pass --force so the command does not prompt for confirmation.
--force means do not prompt for confirmation.
Filters
The --filter flag format is key=value. If there is more than one filter, pass multiple flags.
When multiple filters are provided, a container must satisfy all filter conditions to be pruned.
For one key, a container is pruned if it matches any of the values for that key.
The until filter can limit removal to containers created before a given timestamp.
See also
Claims
- id: C1 claim: The command removes all stopped containers. source: S1 evidence: "This will remove all stopped containers."
- id: C2 claim: --force skips the confirmation prompt. source: S2 evidence: "Do not prompt for confirmation"
- id: C3 claim: Filter values use a key=value format. source: S2 evidence: "format is of \"key=value\""
- id: C4 claim: A container must satisfy all filter conditions to be pruned. source: S1 evidence: "A container must satisfy all filter conditions to be pruned."
Sources
- [S1] docker container prune. Docker Docs. https://docs.docker.com/reference/cli/docker/container/prune/ . License: Apache-2.0. Accessed 2026-11-23.
- [S2] docker container prune CLI reference. Docker CLI. https://raw.githubusercontent.com/docker/cli/master/docs/reference/commandline/container_prune.md . License: Apache-2.0. Accessed 2026-11-23.
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 prune; Docker CLI, docker container prune CLI 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 prune; Docker CLI, docker container prune CLI 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 container prune: remove all stopped containers." iinventedlight Library, iil:note:18zxvg8c, version of 2026-11-23. https://iinventedlight.com/library/notes/docker-container-prune/. License: CC-BY-4.0.
@misc{iil_note_18zxvg8c,
author = {{iinventedlight}},
title = {{docker container prune: remove all stopped containers}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-23},
url = {https://iinventedlight.com/library/notes/docker-container-prune/},
note = {Permanent ID iil:note:18zxvg8c. 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-container-prune.schema.json (schema; CC-BY-4.0)
- docker-container-prune.table.json (table; 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-container-prune.md.