Skip to content
Latchkey

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:latest

On 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →