failed to solve: process "/bin/sh -c ..." did not complete successfully: exit code: 1
A RUN step in your Dockerfile failed. The real error is printed in the lines just above this message.
did not complete successfully: exit codereturned a non-zero codefailed to solve: processexecutor failed running Meaning
BuildKit stops at the first RUN command that exits non-zero and reports it with this generic line (the legacy builder says “The command '/bin/sh -c …' returned a non-zero code”). Scroll up for the actual failure: npm/pip errors, missing packages, network/DNS, or out-of-memory (exit code 137).
Common causes
- The command itself failed (npm install, pip install, make)
- apt/apk package not found (missing apt-get update)
- No network/DNS during build
- Build runs out of memory (exit code 137)
- Command assumes a file not copied yet
⚡ Quick fix
- Read the log above the error, or rebuild with --progress=plain --no-cache
- Run the failing command in an interactive container from the previous stage
- Combine apt-get update && apt-get install in one RUN
Detailed fix by platform
Docker
docker build --progress=plain --no-cache -t app . 2>&1 | tail -60
Dockerfile
- bash
RUN apt-get update && apt-get install -y --no-install-recommends curl \\ && rm -rf /var/lib/apt/lists/*
How to diagnose
- Real error — Lines just before "did not complete successfully"
- Exit code — 1 (command), 127 (not found), 137 (OOM)
- Reproduce — docker run -it <base> sh and run the step
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Docker
- docker-credential-desktop error getting credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH
- denied denied: requested access to the resource is denied (docker push)
- Mounts denied Docker Desktop: Mounts denied: The path is not shared from the host and is not known to Docker
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 15 Oct 2026