| Field | Value |
|---|---|
| Status | Accepted |
| Decided | 2026-06 (issue #1338) |
| Authority | services/docker-compose.yml (vault-agent-*-bootstrap) |
When the AIXCL stack starts, bootstrap containers must write initial service
passwords into Vault KV. The original design kept these containers running
with an infinite loop (while true; do sleep 30; fetch_bootstrap_password; done).
This created two problems:
- The Vault root token was held in a long-lived container environment -- a security risk if the container is inspected or its env exported.
- On stack restart, the bootstrap containers re-ran the bootstrap logic unnecessarily, sometimes overwriting credentials that services were using.
Bootstrap containers are one-shot:
- The bootstrap script runs once, writes the credential to Vault KV, then exits 0.
- On failure, the script exits non-zero.
- The compose service uses
restart: on-failureso Docker/Podman retries only on failure. On success, the container stays stopped.
- Security: Root token is in the container environment only for the duration of the bootstrap operation (seconds), not indefinitely.
- Idempotency: A stack restart does not re-run bootstrap for already-initialised services. The compose service stays stopped after successful exit 0.
- Simplicity:
restart: on-failureis the standard Docker pattern for one-shot initialisation containers. No custom logic needed.
- Do NOT add
while true; do sleep 30; ...; doneto bootstrap scripts. - Do NOT change
restart: on-failuretorestart: unless-stoppedon bootstrap containers. - Bootstrap containers that are stopped (not running) after stack start is CORRECT behaviour.
- If a bootstrap container is restarting repeatedly, it is failing -- check Vault connectivity.
services/docker-compose.yml--vault-agent-*-bootstrapservice definitionsscripts/vault/bootstrap-password-*.sh-- the one-shot scripts