#!/usr/bin/env bash check_required() { type docker &> /dev/null || { echo "Requiring 'docker' but it's not installed"; exit 1; } type yes &> /dev/null || { echo "Requiring 'yes' but it's not installed"; exit 1; } } check_required echo "Doing docker housekeeping for containers, images and volumes"; yes | docker container prune yes | docker image prune yes | docker volume prune