Modern software development demands fast, portable, and efficient CI/CD pipelines. Traditional tools like GitHub Actions, GitLab CI/CD, and Jenkins rely heavily on YAML-based configurations, making them hard to debug and maintain.

Enter Dagger – a developer-centric CI/CD engine that lets you define pipelines using real programming languages like Go, Python, and Node.js, eliminating the need for complex YAML configurations.

Key Benefits of Dagger:

  • Portable & Fast – Uses Docker BuildKit for caching and speed.
  • Write Pipelines in Code – Define workflows in Go, Python, or Node.js instead of YAML.
  • Run Locally & in CI/CD – Test pipelines locally before pushing to production.
  • Cloud & On-Prem – Works across multiple cloud providers and on-prem setups.

With Dagger, your DevOps team or DevCare engineers can seamlessly run and debug pipelines locally before deploying them to production, ensuring a consistent, reproducible environment across development, staging, and CI/CD systems—eliminating „works on my machine” issues and speeding up iteration cycles.

🚀 Dagger in Action – Code Examples

1. No More YAML Soup

Replace complex CI with a programmable platform. Dagger automatically generates a DAG to run your pipeline steps concurrently to maximize pipeline speed and accuracy.

@func()
  async ci(source: Directory): Promise<string> {
    // Use Golang module to configure project
    const goProject = dag.golang().withProject(source)
    // Run Go tests using Golang module
    await goProject.test()
    // Get container with built binaries using Golang module
    const image = await goProject.buildContainer()
    // Push image to a registry using core Dagger API
    const ref = await image.publish("ttl.sh/demoapp:1h")
    // Scan image for vulnerabilities using Trivy module
    return dag.trivy().scanContainer(dag.container().from(ref))
  }

2. Simple Dagger Pipeline (Node.js)

Here’s a basic example of running a Node.js build and test pipeline using Dagger in JavaScript:

import { connect } from "@dagger.io/dagger";
async function main() {
  const client = await connect();
  const node = client
    .container()
    .from("node:18")
    .withExec(["npm", "install"])
    .withExec(["npm", "run", "test"]);
  await node.stdout();
}
main().catch(console.error);

3. Dagger Pipeline in Python

The same pipeline using Python:

import dagger
async def main():
    async with dagger.Connection() as client:
        node = (
            client.container()
            .from_("node:18")
            .with_exec(["npm", "install"])
            .with_exec(["npm", "run", "test"])
        )
        print(await node.stdout())
dagger.run(main)

With Dagger, you’re not just configuring CI/CD workflows – you’re coding them with full flexibility and reusability.

Comparison Table: Dagger vs. Other CI/CD Tools

Now, let’s add a detailed comparison table showing how Dagger stacks up against GitHub Actions, GitLab CI/CD, Jenkins, and ArgoCD.

Feature Dagger 🐍 GitHub Actions 🚀 GitLab CI/CD 🦊 Jenkins ☕ ArgoCD 🎯
Pipeline as Code ✅ Go, Python, Node.js ✅ YAML ✅ YAML ✅ Groovy ✅ Kubernetes YAML
Container-based ✅ Uses BuildKit ✅ Supports containers ✅ Supports containers ✅ Can run in containers ✅ Kubernetes-native
Local Execution ✅ Run pipelines locally ❌ No native support ❌ No native support ⚠️ Possible with workarounds ❌ Meant for K8s deployments
Flexibility ✅ Use any language ⚠️ Limited to YAML ⚠️ Limited to YAML ✅ Groovy scripting ❌ Focused on GitOps
Speed & Efficiency ✅ Optimized with BuildKit caching ⚠️ Can be slow ⚠️ Can be slow ❌ Requires optimizations ✅ Kubernetes-native
Vendor Lock-in ✅ Fully portable ❌ Tied to GitHub ❌ Tied to GitLab ⚠️ Self-hosted but plugin-heavy ✅ Kubernetes-native
Best Use Case ✅ Local dev, multi-cloud, portable pipelines ✅ GitHub projects ✅ GitLab-hosted CI/CD ✅ Complex enterprise setups ✅ Kubernetes deployments

Dagger: From React to Go and WebAssembly

Dagger originally used React for its web interface, but the team decided to switch to Go and WebAssembly to improve performance, simplify the tech stack, and reduce complexity. By leveraging Go for the frontend, they achieved a 20x reduction in bundle size, eliminated the need for Node.js dependencies, and significantly improved load times. This shift showcases how Go can be a powerful alternative to JavaScript frameworks, especially for high-performance, minimal-overhead applications. 🚀

Why Choose Dagger?

If you want a lightweight, fast, and flexible CI/CD solution that allows you to write pipelines as code, Dagger is worth considering. It’s perfect for developers tired of managing YAML files and needing a local-first, container-based CI/CD system.