Last active
January 3, 2022 04:26
-
-
Save quickmute/5bee93a4f5176c0ed0e7b6979ba8df54 to your computer and use it in GitHub Desktop.
Run inotifywait to update ecr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# get Docker Root Director | |
DOCKERROOT=`docker info | grep 'Docker Root Dir' | awk -F ": " '{print $2}'` | |
# Append the image SHA256 to the above path, this is where the new images go | |
IMAGEMETADATA="$DOCKERROOT/image/overlay2" | |
# create a notify event on this dir, specifically we are watching repositories.json file | |
sudo inotifywait -m -e moved_to $IMAGEMETADATA \ | |
| while read FILENAME | |
do | |
/home/ubuntu/update_ecr.sh | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment