docker/build-push-action "failed to solve" - Buildx not set up
build-push-action drives a buildx builder. Without a prior docker/setup-buildx-action step there is no buildkit instance to solve the build graph, so the build fails.
What this error means
The build-push step fails with "failed to solve" or complains the buildx builder is missing.
ERROR: failed to solve: failed to read dockerfile: buildx builder not initialized
##[error]buildx call failed with: ERROR: failed to solveDiagnose it: is the job queued, or is the runner gone?
A job that never starts and a job whose runner disappeared mid-run look similar in the UI and have opposite causes. The first is a labelling or capacity problem, the second is the runner being killed, usually by memory pressure or a spot reclaim.
- name: Runner facts
run: |
echo "runner name: $RUNNER_NAME"
echo "os/arch: $RUNNER_OS/$RUNNER_ARCH"
nproc; free -h; df -h /
echo "labels this job asked for: ${{ toJSON(job) }}"Common causes
Missing setup-buildx step
No docker/setup-buildx-action ran, so build-push has no builder to use.
Builder failed to initialize
setup-buildx ran but the driver could not start, leaving no usable builder.
How to fix it
Add setup-buildx before build-push
- Insert a docker/setup-buildx-action step before the build.
- Optionally add setup-qemu for multi-arch.
- Re-run; build-push uses the initialized builder.
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/${{ github.repository }}:latestThe failures that are not your workflow
- Exit 137 is the kernel out-of-memory killer, not an application error. Check
free -habove against your peak usage. - Disk exhaustion presents as unrelated write errors deep in a build. GitHub-hosted runners ship roughly 14 GB of free space, which a Docker-heavy job can exhaust.
- A lost connection to the server on a self-hosted runner is usually the host being reclaimed or rebooted, not a network fault in your job.
- A job that starts and immediately fails with no step output normally failed during runner setup, before your workflow ran at all.
How to prevent it
- Always run setup-buildx-action before build-push-action.
- Check the builder startup logs when the solve step fails immediately.