Command
Debug Container
Finds why a Docker container exits, restarts or misbehaves by reading its logs, exit code, config and Dockerfile together.
11. Inspect state with read-only commands: `docker ps -a --filter "name=..."`, `docker inspect --format '{{.State.ExitCode}} {{.State.OOMKilled}} {{.State.Error}}' <c>`, and `docker logs --tail 100 <c>`.
22. Read the exit code: 0 means the main process finished, 1 an app error, 125 to 127 a bad command or missing binary, 137 killed (memory limit or manual stop), 139 a crash, 143 stopped by SIGTERM.
33. Compare the entrypoint and CMD from `docker inspect` with the Dockerfile. Look for shell versus exec form, missing executable bits, wrong WORKDIR, a process that daemonizes and exits, and files removed by .dockerignore.
44. Check configuration: environment variables, mounted volumes, network and published ports, healthcheck result, and depends_on ordering in the compose file.
55. If the container is running, you may use `docker exec <c> ls` or `env` to look inside. Do not change anything.
docker
Debug Container
Commanddocker
Free