Skip to content

Instantly share code, notes, and snippets.

@TopperBG
Created November 10, 2022 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TopperBG/c8b03ca1fb431e04b4bb0d21e26b8622 to your computer and use it in GitHub Desktop.
Save TopperBG/c8b03ca1fb431e04b4bb0d21e26b8622 to your computer and use it in GitHub Desktop.
Find dirs with docker update file "run" end execute them
#!/bin/bash
for i in $(find /root/Docker/ -type f -name "run")
do (
cd $(dirname $(realpath $i));
bash run;
)
done
count=$(docker ps | wc -l)
let "count-=1" #remove first line of description
#could be used: docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
echo y | docker image prune -a
echo -e "Containers runing $count"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment