Skip to content

Commit 680ff01

Browse files
committed
[FAB-8600]Clear hyperledger-related containers only
Change-Id: If45759c6db4b6e63aaadd1c86d31f1332a5aee53 Signed-off-by: alex <alexliusch@gmail.com>
1 parent 2bbb0a8 commit 680ff01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

first-network/byfn.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function askProceed () {
8787
# Obtain CONTAINER_IDS and remove them
8888
# TODO Might want to make this optional - could clear other containers
8989
function clearContainers () {
90-
CONTAINER_IDS=$(docker ps -aq)
90+
CONTAINER_IDS=$(docker ps -a |awk '($2 ~ /dev-peer.*.mycc.*/) {print $1}')
9191
if [ -z "$CONTAINER_IDS" -o "$CONTAINER_IDS" == " " ]; then
9292
echo "---- No containers available for deletion ----"
9393
else
@@ -99,7 +99,7 @@ function clearContainers () {
9999
# specifically the following images are often left behind:
100100
# TODO list generated image naming patterns
101101
function removeUnwantedImages() {
102-
DOCKER_IMAGE_IDS=$(docker images | grep "dev\|none\|test-vp\|peer[0-9]-" | awk '{print $3}')
102+
DOCKER_IMAGE_IDS=$(docker images|awk '($1 ~ /dev-peer.*.mycc.*/) {print $3}')
103103
if [ -z "$DOCKER_IMAGE_IDS" -o "$DOCKER_IMAGE_IDS" == " " ]; then
104104
echo "---- No images available for deletion ----"
105105
else

0 commit comments

Comments
 (0)