From fdd48ba14d5a589040c349194121e16021a8aa6e Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 10 May 2023 12:36:44 +0100 Subject: [PATCH] feat(scripts): stop all Docker containers --- bin/stop-all-docker-containers | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 bin/stop-all-docker-containers diff --git a/bin/stop-all-docker-containers b/bin/stop-all-docker-containers new file mode 100755 index 0000000..69e59a4 --- /dev/null +++ b/bin/stop-all-docker-containers @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# Stops all running Docker containers except for the global Traefik proxy. + +set -euo pipefail + +# Show the running containers. +docker container ps + +echo "" + +# Stop the running containers and show any that are still running. +docker container ls | + tail -n +2 | + grep -v traefik-development-reverse-proxy-1 | + awk '{print $1}' | + xargs docker container stop +echo "" +docker container ps