Interview Prep/Docker/Limits, logging, health checks and restarts

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.

All Docker questions Roadmap: Docker & containers

More on Limits, logging, health checks and restarts