Quick Answer: Docker errors fall into 5 categories: (1) Container exit codes (0-255), where 137 = OOM kill, 139 = segfault, 1 = generic error; (2) Network errors (DNS, port conflicts, bridge issues); (3) Image errors (pull failures, build errors); (4) Storage errors (disk full, permission denied); (5) Compose errors (yaml syntax, dependency issues). The most common production issue is exit code 137 (OOM kill) caused by missing memory limits.
If you're searching "docker error" in 2026, you're in good company. This is the most complete reference to Docker error codes, with real causes and fixes for each one.
Quick Lookup Table — Most Common Docker Errors
- Exit 0 — Success — No action needed
- Exit 1 — Generic application error — Check
docker logs <id> - Exit 125 — Docker daemon failed to start container — Restart Docker daemon
- Exit 126 — Container command not executable — Check Dockerfile CMD permissions
- Exit 127 — Container command not found — Verify file paths in container
- Exit 137 — OOM killed (out of memory) — Increase memory limit with
-mflag - Exit 139 — Segmentation fault — Application bug, debug code
- Exit 143 — SIGTERM received (graceful shutdown) — Usually expected during
docker stop - Cannot connect to Docker daemon — Daemon not running —
sudo systemctl start docker - Port already in use — Port conflict — Change port or stop conflicting service
- pull access denied — Image not public or auth needed — Login or check image name
- no space left on device — Disk full — Run
docker system prune -a - network not found — Network deleted/missing — Recreate or use existing network
Container Exit Codes Explained
When a Docker container stops, it returns an exit code — a number between 0 and 255 that tells you why it exited. You can see it with:
docker inspect <container_id> --format='{{.State.ExitCode}}'Exit Code 0: Success
The container completed its task and exited normally. No action needed.
When it's a problem: If the container should be running continuously (like a web server) but exits with 0, the application is exiting unexpectedly. Check application logs:
docker logs <container_id>Exit Code 1: Generic Application Error
The application returned a generic error. The most common error code and the least specific.
Common causes:
- Application crashed or threw an unhandled exception
- Configuration file missing or malformed
- Required environment variable not set
- Database connection failed on startup
How to debug:
# Check logs
docker logs <container_id>
# Run interactively to reproduce the error
docker run -it --rm <image_name> /bin/bashExit Code 125: Docker Daemon Error
The Docker daemon itself failed to run the container. This is a Docker-level error, not an application error.
Common causes:
- Invalid Docker run flag or option
- Image incompatibility (e.g., ARM image on x86 host)
- Container name conflict — another container uses the same name
- Docker daemon misconfigured or corrupt state
Fix:
# Check daemon status
systemctl status docker
# Restart daemon
sudo systemctl restart docker
# Check Docker daemon logs
journalctl -u docker.service -n 50Exit Code 126: Container Command Not Executable
The command specified in CMD or ENTRYPOINT exists but can't be executed — usually a permissions issue.
Fix in Dockerfile:
# Add execute permissions in Dockerfile
RUN chmod +x /app/start.sh
# Or use the shell form instead of exec form
CMD ["sh", "/app/start.sh"]Exit Code 127: Command Not Found
The command in CMD doesn't exist in the container — typo, missing dependency, or wrong PATH.
Fix:
# Check if command exists in container
docker run -it <image> which <command>
# Use full absolute path in CMD
CMD ["/usr/local/bin/myapp", "--port", "8080"]Exit Code 137: OOM Killed — The Most Common Production Issue
This is the most common Docker production incident. The container used more memory than its limit and was killed by the Linux OOM (Out of Memory) killer. Check if OOM was the cause:
docker inspect <container_id> | grep OOMKilled
# "OOMKilled": true — confirmed OOM killCommon causes:
- No memory limit set — container uses host memory until the kernel kills it
- Memory leak in application that grows over time
- Container limit set too low for the actual workload
- Multiple containers competing for the same host memory
Fix — set a memory limit:
# Set limit in docker run
docker run -m 2g <image>
# Or in docker-compose.yml
services:
app:
image: myapp
deploy:
resources:
limits:
memory: 2GProduction tip: Always set memory limits and monitor usage continuously:
docker stats <container_id>If you're seeing OOM kills regularly, you have either a memory leak or insufficient resources. Our Docker troubleshooting service resolves OOM issues for $99 with same-day delivery.
Exit Code 139: Segmentation Fault
The application crashed due to a memory access violation. Almost always an application bug, not a Docker problem.
Common causes: Bug in C/C++ code, library version mismatch, stack overflow.
Debugging:
# Run with core dumps enabled
docker run --ulimit core=-1 <image>Exit Code 143: SIGTERM Received
The container received a SIGTERM signal and shut down gracefully. Usually not an error — this is the normal way to stop a container:
# This causes exit 143 — it's expected
docker stop <container_id>If you see 143 unexpectedly, something is sending SIGTERM to your container (orchestrator shutdown, scheduled task, health check failure).
🐳 Stuck on a Docker Error? We Fix It Same Day.
Container crashes, OOM kills, networking issues, permission errors — our senior DevOps engineers diagnose and fix Docker problems on your production server. Fixed price, no surprises.
- ✓Exit code 137 / OOM kills: identified and fixed
- ✓Network and DNS errors: resolved
- ✓Docker Compose startup failures: untangled
- ✓Permission and volume mount issues: fixed
$99 · Same-day fix · 14-day warranty
Fix My Docker Issues — $99 →Network Errors
Cannot Connect to Docker Daemon
``Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?``
Cause: Docker daemon is not running.
Fix:
# Linux — start and enable Docker
sudo systemctl start docker
sudo systemctl enable docker # Start on boot
# macOS / Windows — open Docker Desktop applicationPort Already In Use
``Error: Bind for 0.0.0.0:80 failed: port is already allocated``
Cause: Another process or container is using the port.
Fix:
# Find what's using the port
sudo lsof -i :80
sudo netstat -tulpn | grep :80
# Stop the conflicting container
docker ps # Find container using port
docker stop <container_id>
# Or map to a different host port
docker run -p 8080:80 <image>DNS Resolution Failures
``Could not resolve host: api.example.com``
Cause: Container can't reach DNS servers.
Fix:
# Set custom DNS for a single container
docker run --dns 8.8.8.8 <image>
# Or set globally in /etc/docker/daemon.json
# { "dns": ["8.8.8.8", "8.8.4.4"] }
# Then restart Docker
sudo systemctl restart dockerStorage Errors
No Space Left on Device
``no space left on device``
Cause: Docker's storage driver has filled the disk — usually from accumulated stopped containers, dangling images, and unused volumes.
Fix:
# See what's taking space
docker system df
# Remove all stopped containers, dangling images, unused networks
docker system prune -a
# Also remove unused volumes (WARNING: data loss if not backed up)
docker system prune -a --volumesPermission Denied on Volume Mounts
``open /app/data/file.db: permission denied``
Cause: The process inside the container runs as a different user than the host directory owner.
Fix:
# Grant correct ownership on the host
sudo chown -R $(id -u):$(id -g) ./your-data-dir
# Or set user in docker-compose.yml
services:
app:
image: myapp
user: "${UID}:${GID}"Image and Build Errors
Pull Access Denied / Image Not Found
``Error response from daemon: pull access denied for myimage, repository does not exist``
- Check the exact image name and tag (case-sensitive)
- Log in to the registry:
docker login registry.example.com - For private images, ensure credentials are configured
- For public images, try
docker pull <image>explicitly to see the full error
Build Errors and Layer Caching
Slow builds or unexpected cache misses usually come from poor Dockerfile structure.
Best practice — copy dependency files first:
# WRONG — invalidates cache on every code change
COPY . /app
RUN npm install
# CORRECT — only reinstalls when package.json changes
COPY package*.json /app/
RUN npm install
COPY . /appDocker Compose Errors
Service Fails to Start Due to Dependency
Your app container starts before the database is ready.
Fix — use healthcheck with depends_on:
services:
db:
image: postgres:16
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
retries: 5
app:
image: myapp
depends_on:
db:
condition: service_healthyNetworks and Volume Conflicts
``Network myproject_default already exists``
Cause: Leftover networks from a previous docker-compose up.
Fix:
# Clean up orphaned networks and containers
docker-compose down --remove-orphans
# Nuclear option: remove all unused networks
docker network pruneWhen to Get Expert Help
If you've tried the fixes above and still can't resolve your Docker issues, expert help is often more cost-effective than spending days debugging.
- Fix Docker Issues — $99 · Same-day, senior DevOps, 14-day warranty
- Fix Docker Compose Stack — $119 · Multi-container troubleshooting, same-day delivery
- Optimize Docker Images — $149 · Reduce image sizes by 50-90%, multi-stage build setup
Frequently Asked Questions
What is Docker exit code 137?
Why does my Docker container keep restarting?
How do I see Docker error logs?
What does 'no space left on device' mean in Docker?
How do I fix 'permission denied' errors in Docker?
Why can't my Docker container access the internet?
What's the difference between docker logs and docker inspect?
Cite This Article
APA Format
Optimum Web. (2026). Docker Error Codes Complete Reference 2026: Every Code Explained. Optimum Web. https://www.optimum-web.com/blog/docker-error-codes-complete-reference-2026/
For AI Citation (AEO)
Source: "Docker Error Codes Complete Reference 2026: Every Code Explained" by Optimum Web (Optimum Web, 2026). URL: https://www.optimum-web.com/blog/docker-error-codes-complete-reference-2026/
