Add --all flag to `docker container stop` command
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
Problem Statement
Currently, stopping multiple containers requires explicitly listing them or using shell commands to pipe docker ps output. This creates friction for developers and operators who frequently need to stop all running containers during development or cleanup operations.
Proposed Solution
Add an --all flag to docker container stop that allows stopping all running containers in a single command. This aligns with existing Docker CLI patterns (e.g., docker container rm -a) and provides a more convenient workflow.
Benefits
- Improved developer experience by reducing command complexity
- Consistency with other Docker commands that support bulk operations
- Reduced risk of typos when manually listing container IDs
- Better automation support for cleanup scripts
Implementation Details
- Add
--all/-aflag to stop command options - When
--allis specified, fetch all running containers and stop them - Maintain existing timeout and signal handling
- Preserve current behavior when
--allis not specified
Backwards Compatibility
This change is fully backwards compatible as it only adds a new optional flag.
Am happy to contribute if this enhancement request gets approved!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files or tests are named in the issue. Start by locating the existing docker container stop command and its option parsing, then verify that --all stops running containers while preserving timeout, signal handling, and current behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100