projects
/
cmccabe-bin
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
f1d1717
)
Add docker-rm-f.sh
author
Colin P. Mccabe
<colin@cmccabe.xyz>
Tue, 29 Nov 2016 22:18:50 +0000 (14:18 -0800)
committer
Colin P. Mccabe
<colin@cmccabe.xyz>
Tue, 29 Nov 2016 22:18:50 +0000 (14:18 -0800)
docker-rm-f.sh
[new file with mode: 0755]
patch
|
blob
diff --git a/docker-rm-f.sh
b/docker-rm-f.sh
new file mode 100755
(executable)
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