Skip to main content

Dagger CUE API

As of Dagger 0.2, the Dagger CUE API can be imported via &

The Dagger CUE API is the set of CUE packages released alongside the Dagger engine.

Developers of other Dagger packages are expected to build on top of these core packages.

Plan definition

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

#Planplan.cueA special kind of program which dagger can execute

Core types

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

#Addresstypes.cueNetwork service address
#CacheDirexec.cueA (best effort) persistent cache dir
#FStypes.cueReference to a filesystem tree
#HealthCheckimage.cueContainer health check
#ImageConfigimage.cueContainer image config
#Mountexec.cueTransient filesystem mount
#Refimage.cueAn address for a remote container image
#Scratchtypes.cueAn empty directory
#Secrettypes.cueSecure reference to an external secret
#Sockettypes.cueReference to a network socket: unix, tcp/udp or npipe
#TempDirexec.cueA temporary directory for command execution

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:

#Copyfs.cueCopy files between two filesystem trees
#DecodeSecretsecrets.cueDecode a secret without leaking its contents
#Difffs.cueExtract the difference between two filesystems as its own file system
#Dockerfileimage.cueBuild a container image using a Dockerfile
#Execexec.cueExecute a command in a docker-compatible container
#Exportimage.cueExport an image as a tar archive
#GitPullgit.cueDownload a repository from a remote git server
#HTTPFetchhttp.cueGet a file from an HTTP server
#Mergefs.cueMerge multiple filesystem trees
#Mkdirfs.cueCreate a directory in a filesystem tree
#NewSecretsecrets.cueCreate a new a secret from a filesystem tree
#Pullimage.cueDownload an image from a docker registry
#Pushimage.cueUpload an image to a docker registry
#ReadFilefs.cueRead the contents of a UTF-8 encoded file from a filesystem tree
#Scratchfs.cueCreate an empty filesystem tree
#Setimage.cueModify a docker image
#Sourcefs.cueAccess the source for the current CUE package
#Subdirfs.cueRead a subdirectory from a filesystem tree
#TrimSecretsecrets.cueTrim leading and trailing space characters from a secret
#WriteFilefs.cueWrite a file to a filesystem tree