This will be a super simple post. Every time I google how to do this because I can’t remember it, I end up spending forever trying to find it. So below is the command I use to gracefully shutdown all my docker instances. I use this on workstations that run a lot of containers like Security Onion or my Portainer setup so I do not have to shut them down one by one. Expedience is the key

docker ps -a -q | xargs docker stop -t 30