Dagger container.exists adds an expand option
Introduced 2026-06-10 · score 0.94
HOW TO USE IT
When checking whether a container path exists, set `expand: true` to expand `$VAR` or `${VAR}` using the container’s environment variables. `expand` defaults to `false`.
query { container { exists(path: "/$VAR/foo", expand: true) } }WHY THIS HELPS
Check whether a container exists while accounting for expanded container state.
REQUIREMENTS AND LIMITATIONS
- Version: v0.21.5
- path (required): Path to check, such as `/file.txt`.
- expand: Boolean; defaults to `false`. When true, expands `$VAR` or `${VAR}` in `path` using the container’s environment variables.
- expectedType: If specified, also validates the file type; allowed values include `REGULAR_TYPE`, `DIRECTORY_TYPE`, and `SYMLINK_TYPE`.
- doNotFollowSymlinks: If specified, do not follow symlinks.
FIRST-PARTY EVIDENCE
- https://github.com/dagger/dagger/releases/tag/v0.21.5
- https://github.com/dagger/dagger/pull/13310
- https://github.com/dagger/dagger/blob/v0.21.5/core/schema/container.go
Check the installed version and the source before using it. Entry JSON