From: Colin P. Mccabe Date: Tue, 29 Nov 2016 22:18:50 +0000 (-0800) Subject: Add docker-rm-f.sh X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=444b95a4c8e1917ddde89c9288b189840d1fdb53;p=cmccabe-bin Add 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