-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e46feed
commit cb4c81f
Showing
2 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
# Docker Cleanup Script | ||
|
||
echo "=====================================" | ||
echo " Starting Docker Cleanup " | ||
echo "=====================================" | ||
|
||
# Remove stopped containers | ||
echo "Removing stopped containers..." | ||
docker container prune -f | ||
|
||
# Remove unused volumes | ||
echo "Removing unused volumes..." | ||
docker volume ls -q | grep -v -E "qualitylab-pro-backend_mysql-volume|quality-lab-pro-react-plotly_qualitylab_node_modules|quality-lab-pro-react-plotly_qualitylab_public" | xargs -r docker volume rm | ||
|
||
|
||
# Remove unused images | ||
echo "Removing unused images..." | ||
docker image prune -a -f | ||
|
||
# Remove unused networks | ||
echo "Removing unused networks..." | ||
docker network prune -f | ||
|
||
# Remove build cache | ||
echo "Removing build cache..." | ||
docker builder prune -a -f | ||
|
||
echo "=====================================" | ||
echo " Docker Cleanup Completed " | ||
echo "=====================================" | ||
|
||
# Show disk usage after cleanup | ||
echo "Disk usage after cleanup:" | ||
docker system df | ||
|
||
exit 0 |
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