Signals and PID 1: why docker stop takes 10 seconds
Select an icon to see what it is.
Step 4 of 6
Exec form makes the app PID 1
An exec-form CMD like CMD ["./app"] starts the program directly, with no shell. The app is PID 1 and receives SIGTERM itself. If it handles the signal, it shuts down cleanly and exits with code 0.
Process tree and result
PID 1 ./appSIGTERM -> handler runs -> app exits, code 0