Skip to content

Commit 44a75e0

Browse files
committed
Kill Running Containers
1 parent ca94881 commit 44a75e0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

services

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,16 @@ loadData () {
3636
}
3737

3838
stoppingContainers () {
39-
echo "Stopping running containers"
40-
${dockerCmd} down -v --remove-orphans
39+
CONTAINERS=$(docker ps -aq)
40+
if [[ -n $CONTAINERS ]]; then
41+
echo "Stopping containers"
42+
docker rm -f $CONTAINERS
43+
fi
44+
VOLUMES=$(docker volume ls -qf dangling=true)
45+
if [[ -n $VOLUMES ]]; then
46+
echo "Removing old volumes"
47+
docker volume rm $VOLUMES
48+
fi
4149
}
4250

4351
displayServices () {

0 commit comments

Comments
 (0)