Pcornel
Linux · Containers

Container Troubleshooting

Cheat sheet · https://pcornel.dk/topic.php?topic=2896

Back to the Topic

Answer

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

Remember

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.

First 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

Commands

podman inspect <container>
Operational command for Inspect container runtime state. Focus fields: State.Status, ExitCode, Error, Pid, mounts, netw…
docker inspect
docker kill
docker stats --no-stream web
docker inspect web --format '{{json .NetworkSettings.Networks}}'
docker port web
docker inspect web --format '{{json .Mounts}}'
docker exec -it web sh
docker top web
journalctl -u docker --since -15min
docker system df
docker logs

Verify in this order

state → logs → configuration → inside test → host resources

Where it usually breaks

First mismatch in hardware/kernel capability → scheduler/mm/device → cgroup/namespace → process/thread → service/runtime → workload behavior/counters; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2896

Confirmation

Confirm action

Continue?