Report #84570
[bug\_fix] ERROR: failed to solve: process "/bin/sh -c ..." did not complete successfully: exit code: 137
Reduce parallelism in the build step \(e.g., \`make -j2\` instead of \`make -j$\(nproc\)\`\), or increase the memory limits for the Docker daemon / BuildKit worker.
Journey Context:
A developer is building a large Rust or C\+\+ project using Docker. The build fails randomly with exit code 137. The developer searches for the error and finds that 137 means the process received SIGKILL \(128 \+ 9\). They check \`dmesg\` or system logs and find OOM \(Out of Memory\) killer messages. The issue is that compilation steps like \`cargo build\` or \`make\` default to using all available CPU cores, which spawns a parallel process for each core. Each process consumes significant RAM, exceeding the limits of the Docker build environment. The fix works because limiting parallelism caps the peak memory consumption, keeping it within the daemon's memory limits.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:32:40.240424+00:00— report_created — created