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, their settings, and any per-environment overrides. dagger 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>].
envtableNamed environment overlays. See [env.<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.

Resolved image and Git lookups are pinned in dagger.lock alongside the config, and refreshed with dagger update.

[modules.<name>]

[modules.eslint]
source = "github.com/dagger/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 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.
as-sdktableSDK-role data, for module entries that act as an SDK in this workspace. See as-sdk.

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

as-sdk

KeyTypeDescription
namestringSDK name used by dagger module init <sdk> and dagger api client init <sdk>. Defaults to the module entry name.
modulesarrayWorkspace-local modules this SDK authors, each with a path.
clientsarrayGenerated bindings this SDK produces, each with path, module, pin, and options.

[env.<name>]

An environment overlay carries module settings, and may install modules scoped to itself. See Environments.

[env.staging.modules.eslint.settings]
baseImageAddress = "node:22-alpine"
KeyTypeDescription
modules.<name>.settingstableSettings applied on top of the base configuration when the environment is selected.
modules.<name>.sourcestringInstalls a module scoped to this environment. Mirrors [modules.<name>].source.
modules.<name>.pinstringResolved version for the scoped source.

[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.