Migrate the workflow
Apply these changes to your build job:
jobs:
build:
- runs-on: ubuntu-latest
+ runs-on: monkci-ubuntu-24.04-4
steps:
- uses: actions/checkout@v4
- - uses: docker/setup-buildx-action@v3
+ - uses: MonkCi-Inc/setup-docker-builder@v1
- uses: docker/build-push-action@v6
with:
context: .
tags: myorg/myapp:${{ github.sha }}
push: false
- cache-from: type=gha
- cache-to: type=gha,mode=max- 1Change the runner label to a Monk CI runner label.
- 2Replace setup-buildx-action with MonkCi-Inc/setup-docker-builder, which provisions the persistent BuildKit builder.
- 3Remove cache-from and cache-to. Caching is handled by the state volume; the type=gha directives are no longer needed.
···
Configure the builder
setup-docker-builder accepts the following optional inputs:
| Input | Description |
|---|---|
| nofallback | When true, the job fails instead of falling back to a local, cacheless builder. |
| buildkit-version | Pins the BuildKit release instead of tracking the latest. |
Read builder outputs
Assign an id to the setup step to reference its outputs:
| Output | Description |
|---|---|
| cache-hit | true when a warm cache was found and passed pre-flight. |
| cache-role | 'canonical_writer' if the layers are published back to the shared cache, or 'disposable_clone' if they are discarded at job end. |
| builder-name | The buildx builder instance name. |
| volume-name, mount-path | The cache volume identity and mount point, for debugging. |
- uses: MonkCi-Inc/setup-docker-builder@v1
id: builder
with:
nofallback: true
buildkit-version: v0.28.0
- run: echo "cache-hit=${{ steps.builder.outputs.cache-hit }} role=${{ steps.builder.outputs.cache-role }}"Akshit Mandial
Last updated August 7, 2026