19 lines
398 B
Bash
Executable File
19 lines
398 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
echo "Clearing Docker build cache..."
|
|
|
|
# Clear the build cache
|
|
docker builder prune -af
|
|
|
|
# Optional: Also clear dangling images and containers
|
|
echo "Cleaning up dangling images and stopped containers..."
|
|
docker system prune -f
|
|
|
|
echo "Build cache cleared successfully!"
|
|
|
|
# Show disk usage after cleanup
|
|
echo ""
|
|
echo "Docker disk usage after cleanup:"
|
|
docker system df |