Skip to content
Latchkey

Buildah "error building at STEP" in CI

buildah bud (build-using-dockerfile) prints "STEP n/N" as it runs each instruction. "error building at STEP" names the exact instruction that failed; the surrounding output holds the real cause, usually a failing RUN command or a missing COPY source.

What this error means

buildah bud stops with "error building at STEP \"RUN ...\": error while running runtime: exit status 1" or a COPY that cannot find its source.

buildah
STEP 5/9: RUN apt-get update && apt-get install -y libpq-dev
...
error building at STEP "RUN apt-get update && apt-get install -y libpq-dev":
error while running runtime: exit status 100

Common causes

A RUN command exits non-zero

The named STEP is a RUN whose command failed (a package not found, a script error), so the build aborts at that instruction.

A COPY/ADD source is missing from the context

The STEP is a COPY whose source path is not in the build context, mirroring a daemon build failure.

How to fix it

Read the STEP and fix that instruction

  1. Note the STEP number and the instruction text in the error.
  2. For a RUN, reproduce the command and fix the underlying failure (package name, network, exit code).
  3. For a COPY, confirm the source exists in the context you passed to buildah bud.
Terminal
buildah bud -t app:latest -f Dockerfile .

Isolate the failing RUN

Split a compound RUN so the failing command is obvious, then address that specific cause.

How to prevent it

  • Keep RUN commands small so a failing STEP is easy to pinpoint.
  • Confirm COPY sources exist in the build context.
  • Pin package versions so a RUN install does not break unexpectedly.

Frequently asked questions

What causes ""error building at STEP""?
The named STEP is a RUN whose command failed (a package not found, a script error), so the build aborts at that instruction.
How do I fix "error building at STEP"?
Read the STEP and fix that instruction

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card