โšกLocal runs may require sudo. Cloud sandbox recommended for isolation.
Troubleshooting2026-02-23

Docker Exit Code 137 in OpenClaw Running DeepSeek R1

Docker exit code 137 indicates OOM killer termination. In DeepSeek R1 workloads, this is caused by insufficient available memory. This is a hardware ceiling, not a Docker bug.

By: LazyDevโ€ข
#Docker#OOM#Exit Code 137#DeepSeek#Memory#Troubleshooting

Before fixing this error

Many OpenClaw issues are caused by insufficient VRAM or environment mismatch. Running commands blindly may not solve the root cause.

Run 10-Second Preflight Check

Docker Exit Code 137 in OpenClaw Running DeepSeek R1

TL;DR

Exit code 137 means the Linux OOM killer terminated the container.

In DeepSeek R1 workloads, this is almost always caused by insufficient available memory.

This is a hardware ceiling, not a Docker bug.


Symptoms

When running DeepSeek R1 in a Docker container, you may observe:

Container exited with code 137
Killed
CUDA out of memory

The container terminates without a stack trace. The application logs stop abruptly. No error message appears from the model itself.

This behavior indicates the process received SIGKILL (signal 9).


Signal Breakdown

Exit code 137 follows this formula:

137 = 128 + 9
  • 128: Base offset for signal-based exits
  • 9: SIGKILL signal number

SIGKILL cannot be caught, blocked, or ignored. The kernel terminates the process immediately.

In Docker environments, SIGKILL is sent by:

  1. The Linux OOM killer (most common for DeepSeek R1)
  2. Docker daemon when memory limits are exceeded
  3. Manual docker kill commands

Why It Happens

Three factors contribute to exit code 137 in DeepSeek R1 workloads:

  • DeepSeek R1 requires significant VRAM for model weights. The 8B model in 4-bit quantization requires approximately 6 GB VRAM minimum. Full precision requires substantially more.

  • KV cache expands with context length. Each token in the context window allocates additional memory. A 32K context window can consume 2-4 GB additional VRAM.

  • Docker memory limits amplify the failure when VRAM is exhausted. When GPU memory spills to system RAM, Docker's memory constraints trigger OOM termination.


Fast Check

Before adjusting configuration, verify your hardware limits.

Run hardware verification

This diagnostic confirms whether your GPU meets minimum requirements for the selected model.


Hard Limits

The following table shows stable VRAM requirements for DeepSeek R1 variants:

ModelQuantizationStable VRAM Requirement
8B4-bit12โ€“16 GB
8B8-bit16โ€“20 GB
32B4-bit24 GB+
32B8-bit32 GB+

If your GPU has 8GB VRAM, this failure is expected behavior. No configuration adjustment will resolve it.


Confirming OOM as the Cause

Check Docker Events

docker events --filter 'event=oom'

Check System Logs

dmesg | grep -i "out of memory"
dmesg | grep -i "oom"

Check Container Memory Usage

docker stats --no-stream

Expected Output

When OOM is the cause, system logs show:

Out of memory: Killed process 12345 (python) total-vm:32768MB, anon-rss:16384MB

Local Mitigation (Hard Way)

If your hardware meets minimum requirements, these steps may reduce memory pressure:

1. Reduce context window.

Lower the context length from default (typically 4096 or 8192) to 2048 or lower.

OLLAMA_NUM_CTX=2048 ollama run deepseek-r1:8b

2. Lower batch size.

Reduce batch size to 1 if processing multiple requests.

# In vLLM or similar
--max-num-seqs 1

3. Switch to a smaller quantized model.

Use 4-bit quantization instead of 8-bit or full precision.

ollama run deepseek-r1:8b-q4_0

Docker Memory Configuration

Increase Docker Memory Limit

Docker Desktop defaults to 2 GB memory. Increase this value:

docker run --memory=24g --memory-swap=24g your-image

Disable Swap Limit

docker run --memory=24g --memory-swap=-1 your-image

Verify Allocation

docker inspect <container_id> | grep -i memory

Note: Increasing Docker memory allocation does not help if the host system lacks sufficient physical RAM.


Hardware Verdict

When exit code 137 occurs on systems with insufficient VRAM:

Required VRAM: ~14โ€“16 GB Detected VRAM: 8 GB

Conclusion: No configuration change can bypass physical memory limits.

The gap between required and available memory cannot be closed through software configuration.


Escape Option

For systems that do not meet hardware requirements:

Run DeepSeek R1 on a pre-configured 24GB+ GPU instance

Hourly billing. No long-term commitment.

Cloud GPU instances provide:

  • 24 GB+ VRAM (RTX 4090, A100)
  • 64 GB+ system RAM
  • Pre-installed CUDA drivers
  • No Docker memory constraints

Bookmark this site

New fixes are added as soon as they appear on GitHub Issues.

Browse Error Index โ†’

Still want local? Continue debugging โ†’

Still stuck?