How to migrate Docker builds from GitHub-hosted runners to Monk CI

Monk CI runners replace the GitHub Actions cache with a persistent BuildKit state volume. Build layers stay on the local disk between jobs, so builds skip the layer export/import round trip on every run. Repositories with large or frequently rebuilt layer graphs benefit most.

How to migrate Docker builds from GitHub-hosted runners to Monk CI

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
  1. 1Change the runner label to a Monk CI runner label.
  2. 2Replace setup-buildx-action with MonkCi-Inc/setup-docker-builder, which provisions the persistent BuildKit builder.
  3. 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:

InputDescription
nofallbackWhen true, the job fails instead of falling back to a local, cacheless builder.
buildkit-versionPins the BuildKit release instead of tracking the latest.

Read builder outputs

Assign an id to the setup step to reference its outputs:

OutputDescription
cache-hittrue 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-nameThe buildx builder instance name.
volume-name, mount-pathThe 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