fix(ci): bound Docker build cache with BuildKit cache mounts
- Move the pnpm store, apk and .next caches into --mount=type=cache so dependencies are shared across builds instead of duplicated in fresh image layers (was the source of unbounded disk growth). - Replace the deprecated --keep-storage prune flag in ci-deploy.sh with the working --max-used-space=4g (buildx v0.37 renamed the flag). The deprecated flag silently did nothing, so the BuildKit cache kept growing unbounded (was 15.86GB); it is now capped at 4GB after every deploy.
This commit is contained in:
1 parent
c4496e710b
commit
fabd160250
3 files changed
+23
-8
No files matched your search
@@ -176,5 +176,5 @@ while IFS= read -r tag; do
|
||||
if [ -n "$tagged_image" ] && [ "$tagged_image" != "$previous_image" ]; then docker image rm "$tag" || true; fi
|
||||
fi
|
||||
done < <(docker image ls --format '{{.Repository}}:{{.Tag}}' epicnext-cms)
|
||||
docker builder prune -af --filter "until=72h" --keep-storage=2g || true
|
||||
docker builder prune -af --filter "until=72h" --max-used-space=4g || true
|
||||
docker image prune -f --filter "until=168h" || true
|
||||
Reference in new issue
Block a user