This GitHub Action sets up a Docker buildkitd builder with sticky disk cache for improved build performance.
- Sets up buildkitd with a persistent cache stored on a sticky disk
- Automatically mounts the cache at
/var/lib/buildkit
- Handles builder lifecycle (start, configure, cleanup)
- Supports multi-platform builds
- Falls back to local builder if Blacksmith setup fails
- name: Setup Docker Builder
uses: useblacksmith/setup-docker-builder@v1
with:
buildx-version: "v0.23.0" # optional, defaults to v0.23.0
platforms: "linux/amd64,linux/arm64" # optional
nofallback: "false" # optional, defaults to false
github-token: ${{ secrets.GITHUB_TOKEN }} # optional
Name | Description | Required | Default |
---|---|---|---|
buildx-version |
Buildx version (e.g., v0.23.0, latest) | No | v0.23.0 |
platforms |
List of target platforms for build (e.g., linux/amd64,linux/arm64) | No | |
nofallback |
If true, fail the action if Blacksmith builder setup fails | No | false |
github-token |
GitHub token for GitHub API access | No |
- uses: useblacksmith/setup-docker-builder@v1
- uses: useblacksmith/build-push-action@v1
with:
push: true
tags: user/app:latest
- uses: useblacksmith/setup-docker-builder@v1
- uses: useblacksmith/build-push-action@v1
with:
file: ./Dockerfile.app1
tags: user/app1:latest
- uses: useblacksmith/build-push-action@v1
with:
file: ./Dockerfile.app2
tags: user/app2:latest
- uses: useblacksmith/setup-docker-builder@v1
- run: docker buildx bake
- run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag myapp:latest \
.
- The action sets up buildkitd with a sticky disk mounted at
/var/lib/buildkit
- This provides a persistent cache across builds in the same repository
- The builder is configured as the default for all subsequent Docker commands
- In the post-action cleanup, the cache is committed and buildkitd is shut down
- GitHub Actions runner with Docker installed
- Blacksmith environment variables configured