Docker (BuildKit layer cache)
Avrea accelerates Docker builds by serving BuildKit's type=gha cache backend
from a colocated cache instead of GitHub's remote blob storage.
On Avrea runners
Section titled “On Avrea runners”No Avrea-specific configuration is needed. Use docker/build-push-action with
the standard type=gha cache backend:
jobs: build: runs-on: avrea-ubuntu-latest-2-vcpu steps: - uses: actions/checkout@v6 - uses: docker/setup-buildx-action@v3 - uses: docker/build-push-action@v6 with: context: . cache-from: type=gha cache-to: type=gha,mode=maxOn the first run, BuildKit builds all layers and exports them to the cache.
On subsequent runs with unchanged inputs, every RUN step hits the cached
layer and the build completes in seconds.
mode=max vs mode=min
Section titled “mode=max vs mode=min”mode=maxexports all layers, including intermediate build stages. Required for multi-stage builds (e.g. abuildstage that compiles your app and ascratch/alpinefinal stage).mode=min(default) exports only the final image layers. The build stage is not cached and must re-execute on every run.
Use mode=max unless you have a specific reason not to.
Cache scope
Section titled “Cache scope”If you have multiple Dockerfiles or matrix builds, use scope= to isolate
their caches:
cache-from: type=gha,scope=backendcache-to: type=gha,mode=max,scope=backend.dockerignore
Section titled “.dockerignore”Add .git to your .dockerignore — otherwise COPY . . invalidates
the layer cache on every run because .git/ contains files with
different timestamps even when the same commit is checked out.
.git