docker/setup-buildx-action: Enable BuildKit in CI
setup-buildx-action provisions a Buildx builder so build-push-action can use BuildKit.
BuildKit unlocks layer cache exports, multi-platform builds, and faster builds. This action sets up the builder; build-push-action uses it.
Key inputs (with:)
- driver: docker-container (default) or docker.
- install: set as the default docker builder.
- buildkitd-flags: extra flags for the BuildKit daemon.
- platforms: preconfigure target platforms.
Example workflow
.github/workflows/ci.yml
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
tags: myapp:latestOn any runner
Buildx setup runs on any runner with Docker. Latchkey managed runners run it unchanged and add an ECR-backed Docker layer cache.
Key takeaways
- Required before using BuildKit cache or multi-platform builds.
- Pair with setup-qemu-action for cross-arch builds.
- The docker-container driver enables cache export.
Related guides
docker/build-push-action: Build & Push Images in CIReference for docker/build-push-action: build a Docker image with BuildKit and push it to a registry, with ta…
docker/setup-qemu-action: Emulate Other ArchitecturesReference for docker/setup-qemu-action: register QEMU binfmt handlers so Buildx can build multi-architecture…
docker/login-action: Authenticate to a RegistryReference for docker/login-action: log in to Docker Hub, GHCR, ECR, or any registry before pushing images, wi…