Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Container Troubleshooting

Direct answer

Container troubleshooting checks the container's state and logs, its image and configuration, resources, mounts and network, and the host's runtime.

When to use this

Use it when a container will not start, crashes, or cannot reach or be reached.

First 30 seconds

1. Status and exit code: docker ps -a.

2. Logs: docker logs <c>.

3. Config: docker inspect <c> (env, mounts, ports).

4. Inside: docker exec -it <c> sh — process, files, getent hosts.

5. Host: disk, memory, daemon logs (journalctl -u docker).

Operational verification

state → logs → configuration → inside test → host resources

Evidence · next step

For Containers → Container Troubleshooting, continue with the first unproven Topic check: Pin exact host, runtime/hypervisor, object identity, source revision/image/definition and failing workload. If that boundary is healthy, advance to the adjacent check: Read back effective runtime state including process, namespace/resource or virtual-hardware boundaries. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux · Podman
Key commandpodman inspect <container>
Scope / prerequisiteUse it when a container will not start, crashes, or cannot reach or be reached.
Reference · 1
What next?3 suggested next steps
Catalog command links1
Evidence1
On this pageJump to a specific section
Linux command reference

Primary Commands

Configuration and operational commands for this Topic.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

symptom/time → host/runtime → container identity/image/config → process/exit → namespace/cgroup → mount/storage → network/DNS → logs/readiness → original workload

Healthy evidence: the failure is reproducible, one first failing step is evidenced, the fix is minimal and the original workload plus adjacent regression test succeeds

Step 2 Commands Verify boundary
docker logs --tail 100 <ctr>
docker inspect <ctr> --format '{{.State.ExitCode}} {{.State.Error}}'
docker events --since 10m
Step 3 Verification and output interpretation Verify boundary

Verification chain. symptom/time → host/runtime → container identity/image/config → process/exit → namespace/cgroup → mount/storage → network/DNS → logs/readiness → original workload

Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: restart/recreate temporarily clears symptoms, logs are treated as root cause, or running/healthy metadata masks external workload failure

Step 5 Common mistakes Narrow the fault
  • Ignoring the container exit code.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

Start with docker ps -a and docker logs. Exit codes, OOMKilled and restart counts tell a lot. Test from inside the container to separate app from network problems.

Key checks
  • docker ps -a / podman ps -a — containers and state
  • docker logs <c> — container output
  • docker inspect <c> — configuration, mounts, network
  • docker info — engine, storage driver, cgroup version
ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

Troubleshooting closes at the first failed container boundary and only after the original workload passes after a minimal persistent correction.

In depth

Why did the container stop?

$ docker ps -a --filter name=web --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}'
NAMES  STATUS                      IMAGE
web    Exited (137) 2 minutes ago  nginx:1.27
$ docker inspect web --format '{{.State.ExitCode}} OOMKilled={{.State.OOMKilled}} Error={{.State.Error}} Restarts={{.RestartCount}}'
137 OOMKilled=true Error= Restarts=4
$ docker logs --tail 50 --timestamps web

docker inspect returns the full JSON for a container and accepts Go templates via --format.

Exit codeMeaning
0Main process ended normally (container finished its job)
1 / other small numbersApplication error — read the logs
125Docker could not run the container (bad option)
126 / 127Command not executable / not found in the image
137Killed with SIGKILL — OOMKilled=true means memory limit, otherwise docker kill or host OOM
143SIGTERM — normal stop

The main-process rule

A container lives exactly as long as its PID 1. A daemon that forks into the background makes the container exit immediately with code 0. Run services in the foreground (nginx -g 'daemon off;').

Inspect from the inside and the outside

QuestionCommand
Resource usagedocker stats --no-stream web
Network and portsdocker inspect web --format '{{json .NetworkSettings.Networks}}', docker port web
Mounted volumesdocker inspect web --format '{{json .Mounts}}'
Shell in the running containerdocker exec -it web sh
Process from the host's viewdocker top web; ps -o pid,cmd -p $(docker inspect -f '{{.State.Pid}}' web)
Daemon errorsjournalctl -u docker --since -15min

Common faults

FaultClue
Port published but not reachableService listens on 127.0.0.1 inside the container instead of 0.0.0.0
Permission denied on a bind mountUID inside the container differs from file owner on the host; SELinux label (:Z) on RHEL-family hosts
DNS fails inside containersHost resolver is 127.0.0.53 (systemd-resolved stub) — Docker substitutes upstream servers; check /etc/resolv.conf in the container
Disk full on the hostdocker system df; prune unused images/volumes deliberately

*The container exit code and OOMKilled flag are illustrative diagnostics, not a record of an actual container termination.*

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

Container Troubleshooting is part of Containers → Container Troubleshooting. Container Troubleshooting isolates failures from host/runtime and image identity through namespace/resource, mount/network and process/readiness boundaries to the original application request.

Topic-specific state model. Container Troubleshooting isolates failures from host/runtime and image identity through namespace/resource, mount/network and process/readiness boundaries to the original application request.

Method

Container troubleshooting:

SymptomCheck
Exits immediatelydocker logs, entrypoint/command, missing env/config
Exit 137 / OOMKilledMemory limit, app memory
Restart loopHealth check, dependency not ready
Port not reachable-p mapping, app listening on 127.0.0.1 inside container, host firewall
Permission denied on volumeUID/GID mismatch, SELinux (:Z), read-only mount
DNS fails between containersDefault bridge has no name resolution — use user-defined network
docker inspect app --format '{{json .State}}' | jq
docker events --since 10m
nsenter -t $(docker inspect -f '{{.State.Pid}}' app) -n ss -ltnp
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. Troubleshooting closes at the first failed container boundary and only after the original workload passes after a minimal persistent correction.

Snapshot/image existence is not a verified backup.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. Container Troubleshooting owns isolation and hands off to Docker, Linux Networking, Storage, Security or application Topics once confirmed.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Containers → Container Troubleshooting. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.docker.com/engine/ · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
container troubleshootingdocker troubleshootingcontainer not starting
Embedded reference data

Quick lookup tables

Container Troubleshooting operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Container Troubleshooting.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateContainer Troubleshooting isolates failures from host/runtime and image identity through namespace/resource, mount/network and process/readiness boundaries to the original application request.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin host + object identity + source image/definition → verify host/runtime capability → read back effective process/namespace/cgroup or virtual-hardware state → verify storage/network attachments → verify guest/container readiness → repeat original workload + regression check.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainsymptom/time → host/runtime → container identity/image/config → process/exit → namespace/cgroup → mount/storage → network/DNS → logs/readiness → original workloadTrace requested/configured state through effective state to the observed workload result.
Failure boundaryTroubleshooting closes at the first failed container boundary and only after the original workload passes after a minimal persistent correction.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux container/virtualization evidence can establish this proof path: symptom/time → host/runtime → container identity/image/config → process/exit → namespace/cgroup → mount/storage → network/DNS → logs/readiness → original workloadUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove unobserved clients, names, identities, routes, sessions, backends or time periods. Troubleshooting closes at the first failed container boundary and only after the original workload passes after a minimal persistent correction.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven runtime boundary, capture adjacent host/object/resource/attachment evidence, make only the demonstrated persistent change, then repeat the original workload plus a regression check.Continue to the next unresolved boundary while preserving the original test condition.

Container Troubleshooting · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryContainer Troubleshooting
Topic pathContainers → Container Troubleshooting
Runtime stateContainer Troubleshooting isolates failures from host/runtime and image identity through namespace/resource, mount/network and process/readiness boundaries to the original application request.
Fast checks- Pin exact host, runtime/hypervisor, object identity, source revision/image/definition and failing workload. - Read back effective runtime state including process, namespace/resource or virtual-hardware boundaries. - Trace storage and network attachments plus readiness from the real client or dependent workload path. - Apply the smallest persistent change, then repeat the original workload and an adjacent regression check.
Verification chainsymptom/time → host/runtime → container identity/image/config → process/exit → namespace/cgroup → mount/storage → network/DNS → logs/readiness → original workload Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary.
Failure boundaryTroubleshooting closes at the first failed container boundary and only after the original workload passes after a minimal persistent correction. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?