How to Debug a Docker Build With progress plain in GitHub Actions
BuildKit collapses output by default; --progress=plain prints every layer command and its full stdout so you can read the failing step.
Add --progress=plain (and --no-cache when a cached layer hides the bug) to the build. With docker/build-push-action, set DOCKER_BUILDKIT and pass build args the same way.
Steps
- Add
--progress=plainso eachRUNprints its full output. - Add
--no-cacheto rule out a stale cached layer. - Read the expanded output for the real error in the failing layer.
Workflow
.github/workflows/ci.yml
steps:
- uses: actions/checkout@v4
- name: Build with full output
run: |
docker build --progress=plain --no-cache \
-t myapp:ci .
# with the build-push action, plain progress is on by default in CI,
# add no-cache when debugging a layer:
- uses: docker/build-push-action@v6
with:
context: .
no-cache: trueGotchas
- Without
--no-cache, a previously cached failing layer may not re-run and you never see the error. --progress=plainworks only with BuildKit, which is the default in current Docker.- For the deepest build trace, also set
BUILDKIT_PROGRESS=plainin the environment.
Related guides
How to Increase Tool Verbosity in GitHub ActionsGet more detail from a failing command in GitHub Actions by adding the tool verbose flag, such as npm --logle…
How to Debug an OOM Kill With dmesg and free in GitHub ActionsConfirm a GitHub Actions step died to the out-of-memory killer by checking exit code 137, reading dmesg for t…