Skip to content

Instantly share code, notes, and snippets.

@kulongwangzhi85
kulongwangzhi85 / gist:f6036857f9cd835d2daf745c04e6c2b1
Created April 26, 2022 08:19 — forked from freshjones/gist:b0713263033df8cc9f44
bash script to monitor and do something with docker events
#!/bin/sh
docker events --filter 'event=start' --filter 'event=stop' | while read event
do
container_id=`echo $event | sed 's/.*Z\ \(.*\):\ .*/\1/'`
echo $container_id