Skip to content

containertool: Read defaults from containertool.json - #179

Open
amarkdotdev wants to merge 1 commit into
apple:mainfrom
amarkdotdev:containertool-config-file
Open

containertool: Read defaults from containertool.json#179
amarkdotdev wants to merge 1 commit into
apple:mainfrom
amarkdotdev:containertool-config-file

Conversation

@amarkdotdev

@amarkdotdev amarkdotdev commented Jul 31, 2026

Copy link
Copy Markdown

Summary

  • Add project-local containertool.json support so containertool can load defaults for repository, registry, base image, tag, architecture, OS, and credentials.
  • Apply precedence: CLI flags > environment variables > containertool.json > built-in defaults.
  • Discover the config file from the working directory (walking parents) and run the plugin helper from the package directory so the file is found.
  • Document the configuration file and add unit tests for loading/parsing.

Fixes #87

Test plan

  • swift build --product containertool succeeds
  • swift test --filter ConfigurationFileTests
  • Create containertool.json with "repository" and confirm containertool uses it without --repository
  • Set CONTAINERTOOL_REPOSITORY and confirm it overrides the config file
  • Pass --repository and confirm it overrides both env and config

Allow project-local configuration file defaults for containertool
options, overridden by environment variables and CLI flags.

Fixes apple#87

Signed-off-by: amarkdotdev <amarkdotdev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

containertool should read settings from a configuration file

1 participant