BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
yanhuanwang | 4805f96 | 2019-09-11 20:44:10 +0200 | [diff] [blame] | 3 | running_containers=$(docker ps --filter name=dfc_ -qa) |
| 4 | running_images=$(docker images -q) |
BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 5 | |
TamasBakai | e81736c | 2019-08-23 13:31:57 +0000 | [diff] [blame] | 6 | if [ -z "$running_containers" ] |
| 7 | then |
| 8 | echo "No container requires termination" |
| 9 | else |
| 10 | echo "Stopping and removing containers" |
| 11 | docker stop $running_containers |
| 12 | docker rm $running_containers |
yanhuanwang | 4805f96 | 2019-09-11 20:44:10 +0200 | [diff] [blame] | 13 | docker rmi $running_images |
TamasBakai | e81736c | 2019-08-23 13:31:57 +0000 | [diff] [blame] | 14 | fi |
BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 15 | |