- Symptom
- Every run rebuilds from the first RUN step although cache-from type=gha is setEarlier stages of a multi-stage build are always rebuilt
- Cause
- The gha backend writes every image to one default scope named buildkit, so each export overwrites the previous image's cache. The default min mode also caches only layers of the final stage.
- Fix
- Give each image its own scope and export with mode=max.
- Apply
cache-from: type=gha,scope=api cache-to: type=gha,scope=api,mode=max- Affected
- BuildKit gha cache backend, as of October 2026
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders