Dagger is a programmable CI engine that runs pipelines in containers using your preferred language SDK. Its lazy evaluation model, content-addressed caching, and Module system make it a powerful alternative to traditional CI YAML configuration.
0 / 5 completed
1 / 5
In Dagger, what is a Container type, and why is it central to pipeline design?
A Dagger Container is a lazy, immutable object representing a container state (base image, filesystem layers, env vars, commands). Operations like withExec() return new Container values without executing anything. Evaluation happens only when a terminal operation is called, enabling efficient caching and parallelism.
2 / 5
What does container.withExec(['go', 'test', './...']) return in a Dagger pipeline?
withExec() is a lazy builder method. It returns a new Container with the command appended to the execution plan but does not run it immediately. Dagger batches and executes the plan when you request a terminal value like .stdout() or .export().
3 / 5
How do Dagger cache volumes improve build performance?
Dagger cache volumes (client.cacheVolume('name') mounted via withMountedCache()) are named persistent directories that survive between pipeline invocations. Package manager caches (npm, Maven, pip) stored here avoid redundant downloads across runs.
4 / 5
What is a Dagger Module, and how does it differ from a simple pipeline script?
A Dagger Module packages pipeline functions into a reusable, versioned unit. Modules expose typed functions that other Dagger pipelines or Modules can call via dagger install. This enables a composable ecosystem where teams share and version CI building blocks.
5 / 5
A Dagger pipeline written in Python calls the same container.withExec() chain twice with identical inputs. How many times does Dagger actually execute the command?
Dagger uses a content-addressed cache: each operation is identified by a hash of its inputs (base image, commands, env, mounts). Identical operations within a session — or across sessions if the cache is warm — are deduplicated, executing only once regardless of how many times the code references them.