Skip to content

PID 1 and signals

Your process is PID 1, and it owes the system something

Exec form against shell form, why the orchestrator waited ten seconds, and the one pair of brackets that decides it.

Two forms, and they are not a style choice

CMD ["node", "server.js"] is exec form. The runtime execs your process directly, so your process is PID 1 and signals arrive at it.

CMD node server.js is shell form. The runtime runs /bin/sh -c "node server.js", so PID 1 is sh and your application is its child.

sh -c is not a supervisor. It installs no signal handlers, forwards nothing, and reaps nothing — it was never asked to. Every consequence on this page follows from that.

The difference between a container that stops in 200ms and one that is killed after ten seconds is a pair of square brackets.

Dockerfile

  1. 1
  2. 2

Layers

Nothing has been built yet. Press Build and the layers, the digest and the cache ledger appear — not before.

Everything you do here stays in this browser.Part of liter8.sh