This action will create and boot a builder that can be used in the following
steps of your workflow if you’re using Buildx or the build-push action.
By default, the docker-container driver
will be used to be able to build multi-platform images and export cache using
a BuildKit container.
name: ci
on:
push:
jobs:
buildx:
runs-on: ubuntu-latest
steps:
-
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
uses: docker/setup-qemu-action@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
Configuring your builder
Version pinning: Pin to a specific Buildx or BuildKit version
Keep BuildKit state on cleanup. This is only useful on persistent self-hosted runners
cache-binary
Bool
true
Cache buildx binary to GitHub Actions cache backend
cleanup
Bool
true
Cleanup temp files and remove builder at the end of a job
[!IMPORTANT]
If you set the buildkitd-flags input, the default flags (--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host)
will be reset. If you want to retain the default behavior, make sure to
include these flags in your custom buildkitd-flags value.
[!NOTE]
buildkitd-config and buildkitd-config-inline are mutually exclusive.
About
GitHub Action to set up Docker Buildx.
This action will create and boot a builder that can be used in the following steps of your workflow if you’re using Buildx or the
build-pushaction. By default, thedocker-containerdriver will be used to be able to build multi-platform images and export cache using a BuildKit container.nodesoutputUsage
Configuring your builder
Customizing
inputs
The following inputs can be used as
step.withkeys:versionv0.3.0,latest,https://github.com/docker/buildx.git#master)namedriverdocker-containerdriver-optsimage=moby/buildkit:master)buildkitd-flagsbuildkitd-config*buildkitd-config-inline*buildkitd-configbut inlineusetrueendpointdocker context lsplatformsappendkeep-statefalsecleanup. This is only useful on persistent self-hosted runnerscache-binarytruecleanuptrueoutputs
The following outputs are available:
namedriverplatformsnodesenvironment variables
The following official docker environment variables are supported:
DOCKER_CONFIG~/.dockerNotes
nodesoutputnameendpointdriver-optsstatusbuildkitd-flagsbuildkitplatformsExample:
Contributing
Want to contribute? Awesome! You can find information about contributing to this project in the CONTRIBUTING.md