Detect and handle zombie processes in a container.
IntermediateScenarioLimits, logging, health checks and restarts
Answer
Situation read → PID 1 doesn't reap orphaned children, so ps shows <defunct>.
What I'd do → docker run --init (tini) or Compose init: true; or bake tini in the image as ENTRYPOINT. Verify: docker exec c ps -eo pid,ppid,stat,cmd | grep Z.
Why → An init reaps children and forwards signals.
Interview tip → Tini is bundled with Docker since 1.13.
More on Limits, logging, health checks and restarts
A Java container is OOM-killed at 512 MB. Why isn't the heap the whole story?IntermediateHow do you cap CPU and memory for a container and what happens on exceed?BeginnerLatency spikes though CPU usage looks low (50%).Advanced`docker logs` is empty but the app is running.BeginnerConfigure log rotation globally.BeginnerShip container logs to a central system.Intermediate