Skip to content

Commit 31dc33c

Browse files
committed
Kill Running Containers
1 parent aa19ade commit 31dc33c

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
@@ -130,8 +130,16 @@ startContainers () {
130130
}
131131

132132
stoppingContainers () {
133-
echo "Stopping running containers"
134-
${dockerCmd} down -v --remove-orphans
133+
CONTAINERS=$(docker ps -aq)
134+
if [[ -n $CONTAINERS ]]; then
135+
echo "Stopping containers"
136+
docker rm -f $CONTAINERS
137+
fi
138+
VOLUMES=$(docker volume ls -qf dangling=true)
139+
if [[ -n $VOLUMES ]]; then
140+
echo "Removing old volumes"
141+
docker volume rm $VOLUMES
142+
fi
135143
}
136144

137145
command="$1"

0 commit comments

Comments
 (0)