Skip to main content

dagger.toml

A workspace is configured by a dagger.toml file at its root. It records the modules installed in the workspace and their settings. dagger module install creates it on first install.

The machine-readable schema is published at dagger-workspace.schema.json.

Top level​

KeyTypeDescription
modulestableInstalled modules, keyed by install name. See [modules.<name>].
sdkstableInstalled SDK providers and their generation scopes. See [sdks.<name>].
portstableHost port mappings for services. See [ports.<name>].
ignorearrayPath patterns excluded when loading the workspace.
defaults_from_dotenvboolRead module constructor defaults from a .env file.
check-generatedboolRun generators as checks during dagger check, failing when generated files are stale. Defaults to true; CLI flags override it.

dagger.lock​

Resolved image, Git, and vanity URL lookups are pinned in dagger.lock alongside the config. A workspace with multiple dagger.toml files can therefore contain multiple lockfiles.

Run dagger lock update without selectors to refresh every supported entry in the selected lockfile. Selectors refresh matching resources:

dagger lock update node
dagger lock update 'node:lts*'
dagger lock update 'dagger@m*'
dagger lock update github.com/dagger/dagger@refs/heads/main

The node selector matches OCI references whose repository name is node, including docker.io/library/node:lts-alpine. The node:lts* pattern also matches the tag without requiring the registry path. Git identities omit the transport scheme and .git suffix. The dagger@m* pattern matches both refs/heads/main and refs/tags/main in repositories named dagger. A fully qualified ref selects only that branch or tag.

Shell-style patterns can match the full resource identity, and * spans /. Multiple selectors are ORed together, but each selector must match at least one entry. Quote patterns to keep the shell from expanding them:

dagger lock update '*node*' '*python*'

Use dagger lock list to print matching canonical identities without resolving or changing the lockfile. dagger lock update --list produces the same output, so an update can be checked and then applied by removing --list:

dagger lock list dagger
dagger lock update --list dagger
dagger lock update dagger

[modules.<name>]​

[modules.eslint]
source = "dagger.io/js/eslint@v0.3.0"

[modules.eslint.settings]
packageManager = "yarn"
KeyTypeDescription
sourcestringModule address — a workspace-relative path, or a Git ref such as github.com/org/mod@version.
pinstringResolved version for source.
settingstableModule settings. Keys are defined by the module; set them with dagger module settings.
entrypointboolMarks this module as the workspace entrypoint.
legacy-default-pathboolCompatibility flag recorded by workspace migration.
checktableskip = [...] — check functions to exclude from dagger check.
generatetableskip = [...] — generators to exclude from dagger generate.
uptableskip = [...] — services to exclude from dagger up.

Settings can point at another module's output instead of a literal value — see Module wiring.

[sdks.<name>]​

[modules.go-sdk]
source = "dagger.io/sdk/go"

[sdks.go]
module = "go-sdk"

[sdks.go.scopes.".dagger/modules/demo"]
is-module = true
name = "demo"
clients = ["github.com/acme/api"]

[sdks.go.scopes.".dagger/modules/demo".settings]
template = "default"
KeyTypeDescription
modulestringName of the installed module that provides this SDK.
scopestableGeneration scopes, keyed by paths relative to dagger.toml.

Each scope can contain one module, module clients, or both. Client paths are relative to the directory containing dagger.toml. Use ./api, ../api, . or ..; a bare api is not a local path.

Scope keyTypeDescription
is-moduleboolThe scope contains a Dagger module.
namestringOptional scope name. Overrides the inferred module name when is-module is true.
clientsarrayExplicit local paths or module addresses for generated clients. Installed module names are not supported.
settingstableSDK settings for this scope.

module init saves a scope name only when you set --name. It preserves an existing saved name. Before generation, an unnamed module scope uses the name of its local entrypoint installation, if one exists. Otherwise, it uses the scope directory name. A scope at the workspace root uses the config-parent or workspace name with -dev. Multiple matching entrypoint names require an explicit scope name. The inferred name is not written to this field.

Use dagger sdk scope name -u to remove an override. An unnamed scope that contains only clients passes an empty name to the SDK.

[ports.<name>]​

KeyTypeDescription
backendServicestringService that backs this host port.
backendPortintPort on the backing service.

User-level file​

The same module settings can be set per-user, outside the repository, in ~/.config/dagger/config.toml. See User configuration.