Keep credentials and config out of the container image #3

Merged
drawblank merged 1 commit from config-outside-image into main 2026-09-23 14:39:23 +00:00
Owner

Summary

Ensure credentials and config can live entirely outside the container image.

Changes

  • .containerignore: exclude conf.json and .env from the build context, so local config/secrets are never sent to the builder or baked into any layer.
  • src/main.c: expand ${VAR} references in config string values from the environment. A missing variable now aborts startup with a clear message (environment variable X is not set (referenced as ${X})).
  • README.md: document container usage (mounted config + data dirs) and env-var injection.

Verification

  • Native build: 0 warnings; clang-tidy: 0 findings.
  • ${VAR} expansion verified end-to-end (set → expanded; unset → clear failure).
  • Rebuilt image: conf.json not present in the runtime image; binary runs.
## Summary Ensure credentials and config can live entirely outside the container image. ## Changes - **.containerignore**: exclude `conf.json` and `.env` from the build context, so local config/secrets are never sent to the builder or baked into any layer. - **src/main.c**: expand `${VAR}` references in config string values from the environment. A missing variable now aborts startup with a clear message (`environment variable X is not set (referenced as ${X})`). - **README.md**: document container usage (mounted config + data dirs) and env-var injection. ## Verification - Native build: 0 warnings; clang-tidy: 0 findings. - `${VAR}` expansion verified end-to-end (set → expanded; unset → clear failure). - Rebuilt image: `conf.json` not present in the runtime image; binary runs.
- Exclude conf.json and .env from the container build context so local
  config/secrets are never baked into the image
- Expand ${VAR} references in config string values from the environment,
  failing with a clear message if a referenced variable is unset
- Document container usage (mounted config, env-var injection) in README
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
slopnode/bridge!3
No description provided.