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).
#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
- Scroll up to the
ERROR:line that names the failing instruction. - Reproduce that instruction locally to see the real error.
- Fix the Dockerfile or the missing file, then re-run.
docker build -t app:test . # reproduce locallyEnsure the build context is checked out
Run actions/checkout so files referenced by COPY exist, and build from the correct directory.
- uses: actions/checkout@v4
- run: docker build -t app:ci .How to prevent it
- Reproduce docker builds locally before pushing.
- Keep
COPYpaths inside the checked-out context. - Surface the failing instruction, not just the exit code.