sincecutoff.com
← all changes

Dagger module Container arguments accept default addresses

Introduced 2026-02-05 · score 0.97

HOW TO USE IT

When a Dagger Function takes a `Container` argument, set its `defaultAddress` so Dagger loads that image when the caller omits the argument. An explicitly supplied argument value overrides the default.

// +defaultAddress="alpine:latest" ctr *dagger.Container,
{ "function": ["testWithDefaultContainer"], "argument": "ctr", "defaultAddress": "alpine:3.18" }

WHY THIS HELPS

Provide a default base image for a Container argument used by a repository build or test function.

REQUIREMENTS AND LIMITATIONS

  • Version: v0.19.11
  • defaultAddress (required): The container image address to load when this `Container` argument is not set; an explicitly passed argument overrides it.
  • function (required): JSON customization field identifying the function by name; shown as an array containing `testWithDefaultContainer`.
  • argument (required): JSON customization field naming the argument that receives the default address; shown as `ctr`.
  • Prerequisite: The function argument must be of type `Container`; default addresses are only available for `Container` arguments.
  • Default addresses are only available for `Container` arguments.
  • An explicitly passed value overrides the default address.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card