What is `--init` and when do you need it?
IntermediateProductionResource Limits, Health & Reliability
Answer
It runs tini as PID 1 to forward signals and reap zombies. Needed when your app spawns child processes (shell scripts, workers, Chromium) and cannot reap them, or a shell wrapper sits in front. Compose: init: true. Verify zombies with docker top app showing <defunct>.
More on Resource Limits, Health & Reliability
How do you set memory and CPU limits, and what happens when they are exceeded?BeginnerWhat is the difference between `--cpus`, `--cpu-shares` and `--cpuset-cpus`?BeginnerWhat does `--memory-reservation` do?AdvancedHow do you diagnose an OOM-killed container?IntermediateWhy do JVM and Node services in containers need explicit memory flags?IntermediateWhat is CPU throttling, and how do you detect it?Advanced