Container works with `docker run -it` but fails when started detached with `-d`.
IntermediateTroubleshootingContainers that exit, crash or misbehave
Answer
Likely causes → The app expects a TTY or stdin (interactive prompts), or reads from stdin and gets EOF.
Diagnose → docker logs c; compare with docker run -d -t.
Fix → Provide config non-interactively, use -t/-i only if truly needed, or tail -f /dev/null for dev placeholder (not prod).
Prevent → Make apps non-interactive.
More on Containers that exit, crash or misbehave
Container exits immediately with code 0 right after `docker run -d`.Beginner`Exited (137)` with no OOM flag.Intermediate`Exited (139)` segmentation fault.Advanced`Exited (126)` / `Exited (127)`.Beginner`exec /entrypoint.sh: exec format error`Intermediate`docker run` says `WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8)` and the app is very slow.Beginner