From 444b95a4c8e1917ddde89c9288b189840d1fdb53 Mon Sep 17 00:00:00 2001 From: Colin P. Mccabe Date: Tue, 29 Nov 2016 14:18:50 -0800 Subject: [PATCH] Add docker-rm-f.sh --- docker-rm-f.sh | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) create mode 100755 docker-rm-f.sh diff --git a/docker-rm-f.sh b/docker-rm-f.sh new file mode 100755 index 0000000..30bd05b --- /dev/null +++ b/docker-rm-f.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +docker ps | while read C; do + VM_IMAGE=$(echo "${C}" | awk '{print $1}') + if [ "x${VM_IMAGE}" == "xCONTAINER" ]; then + : + else + echo "stopping ${VM_IMAGE}..." + docker stop "${VM_IMAGE}" + echo "removing ${VM_IMAGE}..." + docker rm "${@}" "${VM_IMAGE}" + fi +done -- 1.6.6.rc1.39.g9a42