Entrypoint contract¶
Scope: deployable components only. See the component standard.
How a component's container starts. The rule is simple: the console script is PID 1.
The standard: no entrypoint script¶
The default — what most of the fleet ships — is a direct exec-form entrypoint in the Dockerfile:
ENTRYPOINT ["robotsix-<name>"]
Every duty an entrypoint script used to carry has a better home:
- Signal delivery — exec form makes the console script PID 1, so SIGTERM
from
docker stopreaches the Python process directly. A--watch/daemon subcommand stops cleanly on SIGTERM (log a stop line, drain if mid-cycle, exit 0) — the app implements the handler. - Config validation —
robotsix_config.load_configalready fails fast with a clearMissingConfigError/InvalidConfigError; a shell pre-check duplicates it with a worse message. Bootstrap commands that must run before a config exists (detect,--help,--version) simply don't callload_config— the app knows which of its commands need config, whereas a shell-script allowlist of subcommand names rots the first time one is added. - Config file permissions — enforced by whoever writes the file:
dump_configwrites0600in a0700directory, and central-deploy owns the config volume it writes into. Not a per-containerchmod.
The exception: genuine startup work¶
A component ships an entrypoint.sh only when the container must do real work
before the app can run that the app itself cannot do — the canonical example
is robotsix-mill's privilege drop (start as root, join the host docker-socket
group, runuser down to the app user). If you are not sure you need one, you
don't.
Rules for such a script:
execthe application as the final step — never run the app as a child of the shell, ordocker stopcan't deliver SIGTERM and the container is SIGKILLed after the grace period with no clean shutdown.- Never gate bootstrap commands on config (
--help,detect, …) — a fresh operator must be able to run them before any config exists. - No config templating. Don't template with
envsubst: per the config standard the one config file is the only source of values, so there is nothing to template — andgettext-baseisn't in the runtime image anyway, so the block silently does nothing (a real bug found in the stack). Delete anyenvsubstblock. - Keep it short, and comment why it exists — the script is an exception; the comment is its justification.