The system does not have enough memory to start the container. Free up memory by stopping unused containers, increasing system RAM, or adjusting container memory limits.
This error occurs when the Linux kernel cannot allocate memory for a new container process. The system may be out of physical RAM, swap space, or hitting cgroup memory limits. Docker containers share the host kernel and memory, so host memory pressure directly affects container creation. The error happens at the fork/exec stage when Docker tries to create the initial container process before the application even starts.
See current memory status:
# Overall memory
free -h
# Detailed memory info
cat /proc/meminfo | head -10
# Per-process memory usage
ps aux --sort=-%mem | head -10If available memory is very low, you need to free some up.
See which containers are using memory:
# Memory usage per container
docker stats --no-stream
# Detailed container resource usage
docker stats --format "table {{.Name}} {{.MemUsage}} {{.MemPerc}}"Identify containers using excessive memory.
Free memory by stopping unnecessary containers:
# List all containers
docker ps -a
# Stop specific containers
docker stop <container_name>
# Stop all running containers
docker stop $(docker ps -q)
# Remove stopped containers
docker container prunePrevent containers from consuming too much memory:
# Limit memory when running
docker run -m 512m --memory-swap 1g <image>
# In docker-compose.yml
services:
app:
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 256MThis prevents runaway memory usage.
See if containers were killed by OOM:
# Check system logs
dmesg | grep -i "oom\|killed"
# Check Docker events
docker events --filter type=container --filter event=oom
# Inspect specific container
docker inspect <container_name> | grep -i oomOOM kills indicate memory pressure.
If the system genuinely needs more memory:
# Add swap space (temporary)
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# For Docker Desktop: Settings > Resources > Memory
# Increase the slider and apply changesConsider adding more RAM to the host system.
Docker Desktop Limits: By default, Docker Desktop allocates limited memory. On macOS/Windows, go to Settings > Resources > Advanced and increase memory allocation.
Overcommit Settings: Linux memory overcommit can affect container creation:
cat /proc/sys/vm/overcommit_memory
# 0 = heuristic, 1 = always, 2 = neverMemory Reservation vs Limit: Reservation is soft (guaranteed minimum), limit is hard (cannot exceed). Use both for predictable behavior.
Kubernetes: In K8s environments, check pod resource requests/limits and node allocatable resources.
unable to configure the Docker daemon with file /etc/docker/daemon.json
How to fix 'unable to configure the Docker daemon with file daemon.json' in Docker
docker: Error response from daemon: OCI runtime create failed: container_linux.go: starting container process caused: exec: "/docker-entrypoint.sh": stat /docker-entrypoint.sh: no such file or directory
How to fix 'exec: entrypoint.sh: no such file or directory' in Docker
image operating system "linux" cannot be used on this platform
How to fix 'image operating system linux cannot be used on this platform' in Docker
dockerfile parse error line 5: unknown instruction: RRUN
How to fix 'unknown instruction' Dockerfile parse error in Docker
manifest unknown: manifest unknown
How to fix 'manifest unknown' in Docker