Dagger — Programmable CI/CD Engine
Run CI/CD pipelines as code — locally, in CI, or in the cloud. Replace YAML with real programming languages. Cacheable, portable, testable. 15.6K+ stars.
Instalación con revisión previa
Este activo requiere revisión. El prompt copiado pide dry-run, muestra escrituras y continúa solo tras confirmación.
npx -y tokrepo@latest install 7649c33b-4b70-4395-81d9-68994aaa743a --target codexPrimero dry-run, confirma las escrituras y luego ejecuta este comando.
What it is
Dagger is a programmable CI/CD engine that replaces YAML-based pipeline configurations with real programming languages. You write pipelines in Python, Go, TypeScript, or any language with an SDK, and run them locally on your laptop, in any CI system, or in the cloud. Every step runs in a container with automatic caching.
DevOps engineers and platform teams frustrated with debugging YAML indentation and vendor-specific CI syntax use Dagger to bring software engineering practices (testing, modularity, type safety) to their build pipelines.
How it saves time or tokens
YAML-based CI systems (GitHub Actions, GitLab CI, Jenkins) are hard to test locally and impossible to debug without pushing to the CI server. Dagger pipelines run identically on your laptop and in CI, eliminating the push-and-pray debugging cycle. The built-in content-addressed cache means unchanged steps are skipped on subsequent runs.
Dagger functions are composable and shareable. Instead of copying YAML snippets between repositories, you publish reusable functions that other teams import with type-checked interfaces.
How to use
- Install the Dagger CLI:
curl -fsSL https://dl.dagger.io/dagger/install.sh | sh
- Run a function from a module:
dagger -m github.com/dagger/dagger/dev/go call build --source=.
- Or use the Python SDK:
import dagger
import anyio
async def main():
async with dagger.Connection() as client:
out = await (
client.container()
.from_('python:3.12')
.with_exec(['python', '-c', 'print("hello")'])
.stdout()
)
print(out)
anyio.run(main)
Example
A Dagger pipeline that builds and tests a Go project:
import dagger
import anyio
async def ci():
async with dagger.Connection() as client:
src = client.host().directory('.')
golang = (
client.container()
.from_('golang:1.22')
.with_directory('/app', src)
.with_workdir('/app')
)
await golang.with_exec(['go', 'test', './...']).stdout()
await golang.with_exec(['go', 'build', '-o', 'app']).stdout()
anyio.run(ci)
Related on TokRepo
- DevOps Tools -- Infrastructure and deployment automation tools
- Automation Tools -- CI/CD and build pipeline tools
Common pitfalls
- Dagger requires a running Docker daemon. Rootless Docker works but needs explicit configuration for the Dagger engine socket.
- First-run cold cache is slow because every container layer must be pulled. Subsequent runs with the same dependencies are fast due to content-addressed caching.
- SDK version mismatches between the CLI and language SDK cause cryptic errors. Pin both to the same version in your project.
Preguntas frecuentes
Dagger has official SDKs for Python, Go, and TypeScript. The engine exposes a GraphQL API, so any language that can make GraphQL calls can theoretically drive Dagger pipelines. Community SDKs exist for other languages.
Yes. Dagger runs inside any CI system (GitHub Actions, GitLab CI, Jenkins, CircleCI) as a single CLI call. Your CI config becomes a thin wrapper that invokes `dagger call`, and the actual pipeline logic lives in your codebase as testable code.
Dagger uses content-addressed caching at the operation level. Each container step is cached by its inputs (base image, files, commands). If the inputs have not changed, the cached result is reused. This works identically locally and in CI.
A Dagger Module is a reusable package of functions that others can call. You publish modules to any Git repository and consumers import them by URL. Modules have typed interfaces, so callers get documentation and validation automatically.
No. Dagger uses Docker (or compatible container runtimes) under the hood. It replaces YAML-based CI configurations, not the container runtime itself. You still write Dockerfiles for your application images; Dagger orchestrates the build pipeline.
Referencias (3)
- Dagger GitHub— Dagger is a programmable CI/CD engine with content-addressed caching
- Dagger Documentation— Dagger SDKs for Python, Go, and TypeScript
- Dagger Modules Docs— Dagger Modules for reusable CI/CD functions
Relacionados en TokRepo
Fuente y agradecimientos
Created by Dagger. Licensed under Apache 2.0. dagger/dagger — 15,600+ GitHub stars
Discusión
Activos relacionados
Dagger — CI/CD Pipelines as Code in Any Language
Run CI/CD pipelines locally and in the cloud with the same code. Write pipelines in TypeScript, Python, or Go instead of YAML. Containerized execution ensures identical results everywhere. 12,000+ stars.
Concourse — Container-Native CI/CD with Pipelines as Code
Build reliable CI/CD pipelines with Concourse. Every step runs in an isolated container, pipelines are declarative YAML, and the resource model makes dependencies explicit and reproducible.
Dagger — Programmable Local-First CI Engine
Dagger turns CI into programmable containerized functions. Run the same build graph locally or in CI, with SDKs and observable pipeline execution.
ZeroTier — Programmable Layer-2 Overlay Network
Open-source SD-WAN that builds encrypted peer-to-peer Layer-2 overlays spanning NATs, clouds, and edge devices with a rule engine and controller API.