docker/setup-buildx-action@v4

Set up Docker Buildx

At a glance

Latest major
v4
Repository
docker/setup-buildx-action
Inputs
14 (0 required)
Outputs
7
Runs using
node24
License
Apache-2.0
Last checked

Inputs and outputs come straight from the action's official action.yml. See our editorial standards.

Usage

- uses: docker/setup-buildx-action@v4

Inputs

NameRequiredDefaultDescription
versionNononeBuildx version. (eg. v0.3.0)
driverNodocker-containerSets the builder driver to be used
driver-optsNononeList of additional driver-specific options. (eg. image=moby/buildkit:master)
buildkitd-flagsNononeBuildKit daemon flags
buildkitd-configNononeBuildKit daemon config file
buildkitd-config-inlineNononeInline BuildKit daemon config
useNotrueSwitch to this builder instance
nameNononeName of the builder. If not specified, one will be generated or if it already exists, it will be used instead of creating a new one.
endpointNononeOptional address for docker socket or context from `docker context ls`
platformsNononeFixed platforms for current node. If not empty, values take priority over the detected ones
appendNononeAppend additional nodes to the builder
keep-stateNofalseKeep BuildKit state on cleanup. This is only useful on persistent self-hosted runners.
cache-binaryNotrueCache buildx binary to GitHub Actions cache backend
cleanupNotrueCleanup temp files and remove builder at the end of a job

Outputs

NameDescription
nameBuilder name
driverBuilder driver
platformsBuilder node platforms (preferred or available)
nodesBuilder nodes metadata
endpointBuilder node endpoint (deprecated, use nodes output instead)
statusBuilder node status (deprecated, use nodes output instead)
flagsBuilder node flags (deprecated, use nodes output instead)

Read an output with ${{ steps.<step-id>.outputs.<name> }}; the step needs an id.

Examples

Enable Buildx

Required for cache backends, multi-platform builds and provenance.

name: Example
on:
  push:
    branches: [main]

permissions:
  contents: read

jobs:
  example:
    runs-on: ubuntu-latest
    steps:
      - name: Docker Setup Buildx
        uses: docker/setup-buildx-action@v4

Each example passed actionlint (syntax, expressions and the inputs it knows for this action). They were not run in a live repository, so replace placeholder values such as names, ARNs and paths with your own.

Something out of date or wrong? Report it on our Contact page. This page is rebuilt from the action's repository roughly once a week.