Skip to main content

Module docker_init_option

Module docker_init_option 

Source
Expand description

Parse and validate the opt-in init process for docker isolation (issue #244):

--init      run `docker run --init`, so Docker's bundled tini is PID 1
            and reaps orphaned processes
--no-init   keep the command as PID 1, overriding the environment default

Without either flag, START_COMMAND_DOCKER_INIT=1 turns it on for every docker launch on the host. The default stays off: a command that is its own supervisor keeps today’s behaviour, and recovery works the same for containers started with or without it.

Constants§

DOCKER_INIT_ENV
Environment variable holding the host-wide default.

Functions§

docker_init_from_env_value
Whether an environment value asks for an init process (1, true, yes, on).
parse
Parse --init / --no-init. Returns the number of arguments consumed.
validate
Resolve options.init from the environment. See validate_with_env.
validate_with_env
Resolve options.init to Some(bool): the flag if one was given (None means none), otherwise the environment default for docker launches. Idempotent, because validation may run again on options it already resolved: --no-init (or a resolved false) without docker is the default anyway and is accepted.