Linux Docker Common Errors — Container, Network & Volume Troubleshooting
Errordocker
Overview
Fix common Docker errors including 'no space left on device', 'port already allocated', 'permission denied', DNS failures, and container networking issues.
Key Details
- Docker errors span containers, images, networks, volumes, and the daemon itself
- Storage: Docker uses /var/lib/docker which can fill up with unused images and containers
- Network: Docker creates its own network namespaces and bridge interfaces
- Permissions: Docker daemon runs as root, but container processes may not
- Common errors include exit codes: 0 (success), 1 (app error), 137 (OOM killed), 139 (segfault)
Common Causes
- Docker storage full from accumulated images, containers, and volumes
- Port conflict: host port already in use by another container or service
- DNS not working inside containers (resolv.conf not configured)
- Permission denied when mounting host volumes into containers
- Container OOM killed (exit code 137) due to memory limit
Steps
- 1Clean up storage: docker system prune -a --volumes (removes ALL unused data)
- 2Check port usage: docker ps --format '{{.Ports}}' and lsof -i :PORT
- 3Fix DNS in containers: add --dns=8.8.8.8 to docker run or configure daemon.json
- 4Fix volume permissions: use -u $(id -u):$(id -g) or set proper ownership inside container
- 5Check OOM kills: docker inspect CONTAINER --format='{{.State.OOMKilled}}'
Tags
linuxdockercontainertroubleshootingdevops
Frequently Asked Questions
Exit code 137 = 128 + 9 (SIGKILL). Usually means the container was OOM-killed for exceeding its memory limit.