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: docker rm --all --force Command #5479

Open
schuerg opened this issue Sep 25, 2024 · 2 comments
Open

Feature: docker rm --all --force Command #5479

schuerg opened this issue Sep 25, 2024 · 2 comments

Comments

@schuerg
Copy link

schuerg commented Sep 25, 2024

Description

I’d like to suggest adding an -a, --all option to the docker rm command. With this we could do commands like docker rm --all --force. It would allow us to remove all containers, both running and stopped, with a single command. Currently, we have to stop them first and then remove them, which feels a bit clunky.

Podman has this functionality built in. Adding this option to Docker would streamline the process and improve the user experience.

References

@thaJeztah
Copy link
Member

related to / (partial) duplicate of;

I think this one still needs a wider discussion, because these commands were primarily designed to interact on a single containers, or a list of containers provided as argument. Performing batch operations is somewhat conflicting with that design, which is why this was not implemented originally (besides the potential risk of a single flag being a bit of a "foot-gun" and a destructive operation).

@laurazard
Copy link
Member

I find myself doing docker stop $(docker ps -q) and docker rm $(docker ps -aq) probably to the point where I should've created a shell alias by now, so I do think we should look into. Nonetheless, it might make sense to see where we should implement it, as it could make sense to do it engine-side.

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

No branches or pull requests

3 participants