Types
In addition to basic types (string, boolean, integer, arrays...), the Dagger API also provides powerful types which you can use as both arguments and return values for Dagger Functions.
Each type page combines hand-curated guidance, when available, with a complete schema-generated API reference. The sidebar highlights commonly used core API types; see All types for the complete generated list.
The following table highlights commonly used types:
| Type | Description |
|---|---|
CacheVolume | A directory whose contents persist across runs |
Container | An OCI-compatible container |
CurrentModule | The current Dagger module and its context |
Engine | The Dagger Engine configuration and state |
Directory | A directory (local path or Git reference) |
EnvVariable | An environment variable name and value |
Env | A collection of typed inputs and outputs for an LLM |
File | A file |
GitRepository | A Git repository |
GitRef | A Git reference (tag, branch, or commit) |
Host | The Dagger host environment |
LLM | A Large Language Model (LLM) |
Module | A Dagger module |
Port | A port exposed by a container |
Secret | A secret credential like a password, access token or key) |
Service | A content-addressed service providing TCP connectivity |
Socket | A Unix or TCP/IP socket that can be mounted into a container |
Terminal | An interactive terminal session |
tip
In addition to the default Dagger types, you can create and add your own custom types to Dagger. These custom types can be used in Dagger modules and can be composed with other types to create complex workflows. Learn more about creating custom types and developing Dagger modules.