If you need to delete running containers based on their lifetime, this handy combination of commands can help you. It deletes all containers running for more than 2 hours.HOUR=2
docker ps --filter "status=running" | grep hours | awk '{if ($4 >=$HOUR) print $1,"must be deleted"; system("docker rm -f " $1)}'
Very interesting! Thank you! 🙂
LikeLiked by 1 person