Created
November 10, 2022 07:48
-
-
Save TopperBG/c8b03ca1fb431e04b4bb0d21e26b8622 to your computer and use it in GitHub Desktop.
Find dirs with docker update file "run" end execute them
This file contains 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/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