From dccd41ec13d67fbd9ecefa9a4f8bea005268511a Mon Sep 17 00:00:00 2001 From: hag3 Date: Tue, 11 Dec 2018 10:46:38 +0800 Subject: [PATCH] Add filtering function to the dkcl function The original dkcl function deletes all containers regardless of whether they were started by this sample or not (e.g. rancher/agent). Doing so would corrupt the host's environment and cause inconvenience. So I added conditional filtering to the dkfc function. --- balance-transfer/runApp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/balance-transfer/runApp.sh b/balance-transfer/runApp.sh index e1e7d302..141b3411 100755 --- a/balance-transfer/runApp.sh +++ b/balance-transfer/runApp.sh @@ -6,7 +6,7 @@ # function dkcl(){ - CONTAINER_IDS=$(docker ps -aq) + CONTAINER_IDS=$(docker ps -a | grep "ca_peerOrg\|.example.com" | awk '{print $1}') echo if [ -z "$CONTAINER_IDS" -o "$CONTAINER_IDS" = " " ]; then echo "========== No containers available for deletion =========="