Application can't resolve its own hostname or `sudo: unable to resolve host`.
IntermediateTroubleshootingContainers that exit, crash or misbehave
Answer
Likely causes → Custom --hostname or --network host produce mismatched /etc/hosts; or /etc/hosts overwritten.
Diagnose → docker exec c cat /etc/hosts; hostname
Fix → Use --add-host name:ip, don't edit /etc/hosts manually (it's regenerated on start).
Prevent → Rely on DNS names, not hosts files.
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