blob: 2c46439e3d330b6e4e5385e6c00363be801b8016 [file] [log] [blame]
BjornMagnussonXAd3104ef2019-03-26 12:48:46 +00001#!/usr/bin/env bash
2
yanhuanwang4805f962019-09-11 20:44:10 +02003running_containers=$(docker ps --filter name=dfc_ -qa)
4running_images=$(docker images -q)
BjornMagnussonXAd3104ef2019-03-26 12:48:46 +00005
TamasBakaie81736c2019-08-23 13:31:57 +00006if [ -z "$running_containers" ]
7then
8 echo "No container requires termination"
9else
10 echo "Stopping and removing containers"
11 docker stop $running_containers
12 docker rm $running_containers
yanhuanwang4805f962019-09-11 20:44:10 +020013 docker rmi $running_images
TamasBakaie81736c2019-08-23 13:31:57 +000014fi
BjornMagnussonXAd3104ef2019-03-26 12:48:46 +000015