From 823e32eb8eaa88a2b2eab9aa8ef2f3e52edea9e7 Mon Sep 17 00:00:00 2001 From: burnettk Date: Mon, 17 Oct 2022 21:35:23 -0400 Subject: [PATCH] smash all containers --- bin/smash_all_containers | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 bin/smash_all_containers diff --git a/bin/smash_all_containers b/bin/smash_all_containers new file mode 100755 index 00000000..eb26841a --- /dev/null +++ b/bin/smash_all_containers @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +function error_handler() { + >&2 echo "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}." + exit "$2" +} +trap 'error_handler ${LINENO} $?' ERR +set -o errtrace -o errexit -o nounset -o pipefail + +docker ps | grep -Ev '(static|CONTAINER)' | awk '{print $1}' | xargs docker stop +docker ps -a | grep -Ev '(static|CONTAINER)' | awk '{print $1}' | xargs docker rm