Dagger Documentation
Welcome to Dagger, a programmable tool that lets you replace your software project's artisanal scripts with a modern API and cross-language scripting engine.
- Encapsulate all your project's tasks and workflows into simple Dagger Functions, written in your programming language of choice.
- Run your Dagger Functions from the command line, your language interpreter, or a custom HTTP client.
- Package your Dagger Functions into a module, to reuse in your next project or share with the community.
- Search for existing modules, and import them into yours. All Dagger modules can reuse each other's Dagger Functions - regardless of which language they are written in.
What problem does Dagger solve?
Application delivery pipelines are a source of pain. The majority of pipelines use messy, hard-to-debug YAML, which is not portable across CI providers, and inconsistent shell scripts, which may not work consistently across environments and platforms. Developers have to "push and pray" - instead of being able to test and build code locally and seeing near-instant feedback from their delivery pipelines, they have to wait (and hope) for a green signal from pipelines running on remote servers.
How does Dagger solve this problem?
Dagger solves this by running your application delivery pipelines in containers. A "Daggerized" pipeline runs the same way locally or on your CI provider, resulting in faster feedback to the developer and the elimination of last-minute surprises. Dagger also caches everything, which accelerates each pipeline run significantly and often cuts run times by over 50%. And finally, Dagger supports multiple programming languages via native-language SDKs, enabling developers to build their delivery pipelines in the same language as their application and benefit from the ecosystem's existing tooling and best practices.
Who is Dagger for?
Dagger may be a good fit if you are...
- Your team's "designated devops person", hoping to replace a pile of artisanal scripts with something more powerful.
- A platform engineer writing custom tooling, with the goal of unifying application delivery across organizational silos.
- A cloud-native developer advocate or solutions engineer, looking to demonstrate a complex integration on short notice.
How does Dagger work?
Dagger consists of a number of components, all of which work together in an integrated fashion to orchestrate the delivery of applications to the cloud from start to finish.
Dagger CLI
The Dagger Command-Line Interface (CLI) is your primary entrypoint to Dagger. It is a full-featured, easy to use tool that can be used interactively from a terminal or non-interactively from a shell script or a CI runner. The Dagger CLI also includes a real-time visualization feature called the terminal UI (TUI).
Dagger Functions
Dagger Functions are the fundamental unit of computing in Dagger. Dagger Functions are regular program code, written using a Dagger SDK. With Dagger Functions, you can encapsulate common project operations or workflows, such as "pull a container image", "copy a file", and "forward a TCP port", into portable, reusable program code with clear inputs and outputs. Dagger Functions execute within containers and can be called using the Dagger CLI. Dagger Functions are packaged, shared and reused using Dagger modules.
Dagger Functions are portable and interoperable across languages. For example, a Python function can call a Go function, which can call a TypeScript function, and so on. Dagger is able to do this by "translating" each Dagger Function into GraphQL at runtime and adding it to the Dagger API, thereby making it immediately usable from any other Dagger SDK or any HTTP client. This means that you no longer need to care which language your tooling is written in; you can use the one that you're most comfortable with or that best suits your requirements.
Dagger SDKs
Dagger SDKs contain language-native code bindings for the Dagger API, enabling you to develop Dagger Functions in your preferred programming language. Dagger SDKs are currently available for Go, TypeScript and Python. Support for other languages is available via experimental, community-developed SDKs.
Dagger API
The Dagger API is a unified interface for programming Dagger. It provides a set of powerful core types for creating and managing application delivery pipelines, including types for containers, artifacts, network services, and secrets. It uses GraphQL as its low-level language-agnostic framework, and can be accessed using any standard GraphQL client. In practice, interacting with the API directly is optional; typically, you will use a Dagger Function created with a type-safe Dagger SDK, or the Dagger CLI.
Dagger Cloud
Dagger Cloud complements Dagger with a production-grade control plane. Features of Dagger Cloud include pipeline visualization, operational insights, and distributed caching. Dagger Cloud provides a web interface to visualize each step of your pipeline, drill down to detailed logs, understand how long operations took to run, and whether operations were cached.
Dagger Cloud also collects telemetry from all your organization's Dagger Engines, whether they run in development or CI, and presents it all to you in one place. This gives you a unique view on all pipelines, both pre-push and post-push.
The Daggerverse
The Daggerverse is a free service run by Dagger, which indexes all publicly available Dagger Functions, and lets you easily search and consume them.