fabric-samples/fabric-ca/stop.sh
Latitia M Haskins 2c0c2c7459 [FAB-7910] Clean up chaincode containers in fabric-ca
The stop.sh script cleans up the network and service
containers from the composition file, but does not
clean up the resulting chaincode containers. This
CR removes the chaincode containers and their images
as well.

Change-Id: I06ba13486efc59b4761728891aab27535ae0366d
Signed-off-by: Latitia M Haskins <latitia.haskins@gmail.com>
2018-01-25 14:20:56 -05:00

17 lines
421 B
Bash
Executable file

#!/bin/bash
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
SDIR=$(dirname "$0")
source $SDIR/scripts/env.sh
log "Stopping docker containers ..."
docker-compose down
# Stop chaincode containers and images as well
docker rm -f $(docker ps -aq --filter name=dev-peer)
docker rmi $(docker images | awk '$1 ~ /dev-peer/ { print $3 }')
log "Docker containers have been stopped"