#!/bin/bash
# Add a scheduled task with the following command: 
# echo '0 0 * * * /bin/bash  /opt/scripts/clean-container.sh'  >> /var/spool/cron/root

purge_id=$(docker ps -qf status=exited && docker ps -qf status=created && docker ps -qf status=dead)

if [ -n "$purge_id" ]; then
    docker rm $purge_id
fi
