[CI/Build] Adding a forced docker system prune to clean up space (#9849)

This commit is contained in:
Alexei-V-Ivanov-AMD 2024-10-31 12:02:58 -05:00 committed by GitHub
parent 16b8f7a86f
commit 77f7ef2908
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,8 +31,8 @@ cleanup_docker() {
echo "Disk usage is above $threshold%. Cleaning up Docker images and volumes..."
# Remove dangling images (those that are not tagged and not used by any container)
docker image prune -f
# Remove unused volumes
docker volume prune -f
# Remove unused volumes / force the system prune for old images as well.
docker volume prune -f && docker system prune --force --filter "until=72h" --all
echo "Docker images and volumes cleanup completed."
else
echo "Disk usage is below $threshold%. No cleanup needed."