Handling docker events in shell script
You can try docker events
which continuously console docker event.
docker events
For example if you just interested to grep container started
event the below command will work, or you can improve the below script.
#!/bin/bashdocker events | while read line; do if [[ ${line} = *"start"* ]];then echo " container started ${line}" ;fi ; done