Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] add --all option to docker stop #1679

Open
fakenine opened this issue Feb 19, 2019 · 3 comments
Open

[Feature Request] add --all option to docker stop #1679

fakenine opened this issue Feb 19, 2019 · 3 comments
Labels

Comments

@fakenine
Copy link

Description

When I want to stop all running containers, I have to do a command like this one

$> docker stop $(docker ps -aq)

Proposal

Add a -a, --all option in order to be able to stop all containers in a more simple way

$> docker stop --all

Which would be more intuitive/easy to remember...

I'm willing to work on this one if this is okay.

@collin5
Copy link

collin5 commented Mar 19, 2019

Or a docker container stop --all. Or both.

@theycallmemac
Copy link

theycallmemac commented Jul 4, 2019

I can do the work for this. the stop command requires a container so I'm not terribly sure how Cobra handles that but I'll spend a little time at it all the same.

@theycallmemac
Copy link

theycallmemac commented Jul 8, 2019

Just an update, this can work, but I've only gotten it to work by doing this in cli/command/container/stop.go:

Args: cli.RequiresMinArgs(0)

This isn't ideal. Is there any way in which I can do this better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants