Skip to main content

Dagger CUE API (0.2+)

As of Dagger 0.2 (codename Europa), the Dagger CUE API can be imported at dagger.io/dagger.

The Dagger CUE API is the set of CUE packages released alongside the Dagger engine, to allow developers to access its features.

Plan definition

#Plan defines the structure of a Dagger plan - a complete configuration executable by dagger do.

Core types

Dagger extends the CUE type system with the following core types:

  • #FS: a reference to a filesystem tree
  • #Secret: a secure reference to an external secret
  • #Service a reference to a network service endpoints

Core actions

Dagger works by executing actions in a certain order and passing data between actions in a certain layout.

Developers can combine actions into higher-level actions, which in turn can be combined into even higher-level actions, and so on at arbitrary levels of depth. At the bottom of this abstraction stack are core actions: these are implemented by Dagger itself, and are always available.

The following core actions are available:

Core actionFileDescription
#Execexec.cueExecute a command in a docker-compatible container
#HTTPFetchhttp.cueDownload an archive from an HTTP server
#Pushimage.cueUpload an image to a docker registry
#Pullimage.cueDownload an image from a docker registry
#Dockerfileimage.cueExecute a Dockerfile
#Setimage.cueModify a docker image
#GitPushgit.cueUpload a repository to a remote git server
#GitPullgit.cueDownload a repository from a remote git server
#DecodeSecretsecrets.cueDecode a secret without leaking its contents
#NewSecretsecrets.cueDynamically create a new secret
#Sourcefs.cueAccess the source for the current CUE package
#Mkdirfs.cueCreate a directory in a filesystem tree
#ReadFilefs.cueRead a file from a tree
#WriteFilefs.cueWrite a file to a tree
#Scratchfs.cueCreate an empty tree
#Copyfs.cueCopy files between two trees
#Subdirfs.cueRead a subdirectory from a filesystem tree