Skip to content
Latchkey

docker/setup-buildx-action

Set up Docker Buildx so a workflow can do multi-platform builds and layer caching.

Official actionCategory: Docker & ContainersLatest v3View on GitHub

What it does

docker/setup-buildx-action installs and starts a Buildx builder using the docker-container driver, which is what enables multi-platform builds and the type=gha cache backend.

It is the step you add right before docker/build-push-action.

Usage

workflow (.yml)
steps:
  - uses: docker/setup-buildx-action@v3
  - uses: docker/build-push-action@v6
    with:
      tags: myorg/app:ci

Inputs

InputDescriptionDefaultRequired
driverBuildx driver to use.docker-containerNo
driver-optsOptions passed to the driver.-No
platformsFixed platforms for the builder.-No
installSet Buildx as the default docker builder.falseNo

Outputs

OutputDescription
nameName of the builder instance.
platformsPlatforms the builder supports.

Notes

The default docker-container driver is what makes cache-to: type=gha work; the default docker driver does not support it.

Common errors

  • Cache export is not supported for the docker driver means Buildx is using the plain docker driver. setup-buildx-action selects docker-container, which supports it.

Security and pinning

  • Pin to a commit SHA.

Alternatives and related

Frequently asked questions

Do I always need setup-buildx-action?
For layer caching with type=gha or multi-platform builds, yes. For a simple single-arch build without caching you can skip it.
Running docker/setup-buildx-action? Run it on Latchkey managed runners - self-healing and caching included. Start free → 30-day trial · No credit card