From this tutorial you can write bash script to get email when your container will be in any other state except running like stop, exited and others.
Assume that we have running containers are
- Test1
- Test2
- Test3
- Test4
- Mail server details to send an email and mail template as per your content
Copy the below code in your script file and make changes as per your environment.
vim docker_con.sh