docker / docker/cli

Add --all flag to `docker container stop` command

Open
#5,930 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature status/0-triage
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

  1. Improved developer experience by reducing command complexity
  2. Consistency with other Docker commands that support bulk operations
  3. Reduced risk of typos when manually listing container IDs
  4. Better automation support for cleanup scripts

Implementation Details

  • Add --all/-a flag to stop command options
  • When --all is specified, fetch all running containers and stop them
  • Maintain existing timeout and signal handling
  • Preserve current behavior when --all is 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.