A Docker image build in GitHub Actions dies with "Error: Process completed with exit code 137."

BeginnerTroubleshootingPipeline outages
Answer

Likely causes → The runner ran out of memory and the kernel killed the process (137 = SIGKILL). Common culprits: webpack/TypeScript builds, Gradle daemons, parallel test runners, or docker build with many layers on a small runner.

Diagnose → Re-run with debug logging and print memory in a step (free -m, cat /sys/fs/cgroup/memory.max). Note which step dies.

Fix → Reduce parallelism (--max-workers=2, -Dorg.gradle.workers.max=2), cap tool memory (NODE_OPTIONS=--max-old-space-size=4096), or use a larger runner.

Prevent → Track build memory over time, split huge builds, and use multi-stage Docker builds so heavy compilers don't share memory with test runs.

All Real-World Interview questions Roadmap: Interview readiness

More on Pipeline outages