Error Codes Wiki

Docker Container Errors — Exit Codes, OOMKilled, and Networking Issues

Errordocker

Overview

Fix Docker container errors including non-zero exit codes, OOMKilled, DNS resolution inside containers, port binding conflicts, and volume permission issues.

Key Details

  • Docker exit codes indicate why a container stopped: 0 (success), 1 (app error), 137 (killed/OOM), 139 (segfault)
  • OOMKilled occurs when a container exceeds its memory limit set by --memory flag or system OOM
  • DNS resolution inside containers uses Docker's embedded DNS server (127.0.0.11)
  • Port binding fails if the host port is already in use by another process or container
  • Volume permissions issues arise when container user UID does not match host file ownership

Common Causes

  • Container running out of memory (OOMKilled with exit code 137)
  • Application crash inside the container (exit code 1, check container logs)
  • Port conflict: host port already bound by another container or host process
  • DNS resolution failing inside container due to Docker network misconfiguration
  • Volume mount permissions: container process runs as different UID than host file owner

Steps

  1. 1Check container status: docker ps -a to see exit codes of stopped containers
  2. 2View container logs: docker logs <container_id> --tail 100
  3. 3Check if OOMKilled: docker inspect <container_id> | grep OOMKilled
  4. 4Fix port conflicts: docker port <container> to see port mappings, or change host port
  5. 5Fix DNS: add --dns 8.8.8.8 to docker run or configure /etc/docker/daemon.json
  6. 6Fix volume permissions: match container user UID with host UID, or use --user flag in docker run

Tags

dockercontainerexit-codeoomkillednetworking

Related Items

More in Docker

Frequently Asked Questions

Exit code 137 means the process was killed by signal 9 (SIGKILL). Usually this is the OOM killer terminating the process for exceeding memory limits. Increase --memory or optimize the application.