GitHub Actions setup-buildx "driver-opts invalid"
setup-buildx-action validates driver and driver-opts. Passing an option that the selected driver does not support, or malformed key=value pairs, fails builder initialization. This is a configuration error.
What this error means
The setup-buildx step fails creating the builder, complaining about an unrecognized or malformed driver option.
github-actions
Error: failed to initialize builder: invalid driver-opts: "image=moby/buildkit:latest,network"
unknown driver-opt for driver "docker"Common causes
Option not valid for the chosen driver
A driver-opt like network or image is set on a driver that does not accept it (e.g. the default docker driver).
Malformed key=value list
driver-opts is not formatted as comma- or newline-separated key=value entries.
How to fix it
Use valid options for the driver
- Select the docker-container driver when you need image/network driver-opts.
- Format driver-opts as key=value entries.
- Remove options not supported by the chosen driver.
.github/workflows/build.yml
- uses: docker/setup-buildx-action@v3
with:
driver: docker-container
driver-opts: |
image=moby/buildkit:latestHow to prevent it
- Match driver-opts to the capabilities of the selected buildx driver.
- Keep driver-opts as clean key=value entries.
Related guides
GitHub Actions docker build "--secret id not provided"Fix the GitHub Actions docker build error where a Dockerfile RUN --mount=type=secret references a secret id t…
GitHub Actions "ghcr.io push denied" (packages: write)Fix the GitHub Actions error pushing an image to ghcr.io - the job is missing packages: write or the login to…
GitHub Actions buildx "failed to export gha cache"Fix the GitHub Actions buildx error exporting the gha cache backend during a Docker build.