Skip to content

Commit 45d5258

Browse files
committed
Kill Running Containers
1 parent c78361d commit 45d5258

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

services

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,16 @@ startContainers () {
5454
}
5555

5656
stoppingContainers () {
57-
echo "Stopping running containers"
58-
${dockerCmd} down -v --remove-orphans
57+
CONTAINERS=$(docker ps -aq)
58+
if [[ -n $CONTAINERS ]]; then
59+
echo "Stopping containers"
60+
docker rm -f $CONTAINERS
61+
fi
62+
VOLUMES=$(docker volume ls -qf dangling=true)
63+
if [[ -n $VOLUMES ]]; then
64+
echo "Removing old volumes"
65+
docker volume rm $VOLUMES
66+
fi
5967
}
6068

6169
command="$1"

0 commit comments

Comments
 (0)