Skip to content
Latchkey

GitHub Actions "Process completed with exit code 1" in a Docker build step in CI

A run step fails the job whenever the command exits non-zero. "Process completed with exit code 1" is the generic summary; for a docker build step, the real cause is in the build log above, not in this line.

What this error means

A docker build step ends with "Error: Process completed with exit code 1" after the build log shows the failing instruction (a non-zero RUN, a missing file in COPY, or a failed test).

GitHub Actions
#12 ERROR: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1
Error: Process completed with exit code 1.

Common causes

A Dockerfile instruction failed

A RUN command (build, test, install) exited non-zero, which fails the docker build and the step.

A missing build context file

A COPY/ADD referenced a path not present in the checked-out context, aborting the build.

How to fix it

Read the failing build instruction

  1. Scroll up to the ERROR: line that names the failing instruction.
  2. Reproduce that instruction locally to see the real error.
  3. Fix the Dockerfile or the missing file, then re-run.
Terminal
docker build -t app:test .   # reproduce locally

Ensure the build context is checked out

Run actions/checkout so files referenced by COPY exist, and build from the correct directory.

.github/workflows/ci.yml
- uses: actions/checkout@v4
- run: docker build -t app:ci .

How to prevent it

  • Reproduce docker builds locally before pushing.
  • Keep COPY paths inside the checked-out context.
  • Surface the failing instruction, not just the exit code.

Frequently asked questions

What causes ""Process completed with exit code 1""?
A RUN command (build, test, install) exited non-zero, which fails the docker build and the step.
How do I fix "Process completed with exit code 1"?
Read the failing build instruction

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card