did not complete successfully Docker Origin: Platform & cloud Last updated 15 Oct 2026

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.

Exact message you may see did not complete successfully: exit codereturned a non-zero codefailed to solve: processexecutor failed running
Seen on: Docker

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

  1. Read the log above the error, or rebuild with --progress=plain --no-cache
  2. Run the failing command in an interactive container from the previous stage
  3. Combine apt-get update && apt-get install in one RUN

Detailed fix by platform

Docker

  1. docker build --progress=plain --no-cache -t app . 2>&1 | tail -60

Dockerfile

  1. bash
    RUN apt-get update && apt-get install -y --no-install-recommends curl \\
     && rm -rf /var/lib/apt/lists/*

How to diagnose

  1. Real error — Lines just before "did not complete successfully"
  2. Exit code — 1 (command), 127 (not found), 137 (OOM)
  3. 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:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

COPY failed — COPY failed: file not found in build context / "/app/x": not found (Docker)COPY failedfailed to read dockerfile — failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory (Docker)failed to read docker…forbidden path outside the build context — COPY failed: forbidden path outside the build context: ../file (Docker)forbidden path outsid…lookup registry-1.docker.io: no such host — dial tcp: lookup registry-1.docker.io: no such host / Temporary failure in name resolution during docker build (Docker)lookup registry-1.doc…max depth exceeded — Error response from daemon: max depth exceeded (too many image layers) (Docker)max depth exceededMSB3027 — error MSB3027: Could not copy "obj\...\App.dll" to "bin\...\App.dll". Exceeded retry count of 10. The file is locked by: "App (1234)" (.NET)MSB3027NETSDK1045 — error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 7.0 or lower, or use a version of the .NET SDK that supports .NET 8.0 (.NET)NETSDK1045Output directory not found — Cloudflare Pages build: Error: Output directory "dist" not found / Failed: build output directory not found (Cloudflare)Output directory not …did not c…

Explore the map of this error Full error map →

🧠 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.