I've seen many times the follwoing command to stop all docker containers:
docker stop $(docker ps -a -q)
There are two things that are not clear to me:
What do I miss here? What is the best approach to cleanup an environment after docker?
use this will not run if the docker ps is empty:
docker ps -q | xargs --no-run-if-empty docker stop
normally you use rm and system prune if you really want to cleanup
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With