DaggerIO 0.1.0-preview.2

This is a prerelease version of DaggerIO.
dotnet add package DaggerIO --version 0.1.0-preview.2
                    
NuGet\Install-Package DaggerIO -Version 0.1.0-preview.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DaggerIO" Version="0.1.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DaggerIO" Version="0.1.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="DaggerIO" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DaggerIO --version 0.1.0-preview.2
                    
#r "nuget: DaggerIO, 0.1.0-preview.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DaggerIO@0.1.0-preview.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DaggerIO&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=DaggerIO&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Tool

Dagger SDK for .NET

NuGet License

A client package for running Dagger pipelines in .NET.

What is the Dagger .NET SDK?

The Dagger .NET SDK contains everything you need to develop CI/CD pipelines in C#, and run them on any OCI-compatible container runtime.

Requirements

  • .NET 10.0 or later
  • Docker, or another OCI-compatible container runtime

A compatible version of the Dagger CLI is automatically downloaded and run by the SDK for you.

Installation

dotnet add package DaggerIO

Example

Create a Program.cs file:

using Dagger;

var output = await Dag
    .Container()
    .From("alpine:latest")
    .WithExec(new[] { "echo", "Hello from Dagger!" })
    .StdoutAsync();

Console.WriteLine(output);

Run with:

dagger run dotnet run

Output:

Hello from Dagger!

Note: It may take a while for it to finish, especially on first run with cold cache.

More Examples

Run Tests in a Container

using Dagger;

var exitCode = await Dag
    .Container()
    .From("mcr.microsoft.com/dotnet/sdk:8.0")
    .WithDirectory("/src", Dag.Host().Directory("."))
    .WithWorkdir("/src")
    .WithExec(new[] { "dotnet", "test" })
    .ExitCodeAsync();

Environment.Exit(exitCode);

Build and Publish a Container

using Dagger;

var source = Dag.Host().Directory(".");

// Build
var buildOutput = Dag
    .Container()
    .From("mcr.microsoft.com/dotnet/sdk:8.0")
    .WithDirectory("/src", source)
    .WithWorkdir("/src")
    .WithExec(new[] { "dotnet", "publish", "-c", "Release", "-o", "/app" })
    .Directory("/app");

// Create runtime image
var image = Dag
    .Container()
    .From("mcr.microsoft.com/dotnet/runtime:8.0")
    .WithDirectory("/app", buildOutput)
    .WithEntrypoint(new[] { "dotnet", "/app/MyApp.dll" });

// Publish
var ref = await image.Publish("myregistry.io/myapp:latest");
Console.WriteLine($"Published: {ref}");

Learn More

Creating Reusable Modules

Want to create reusable Dagger modules that others can call? See the module development guide.

License

Apache 2.0 - See LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.2 79 11/29/2025
0.1.0-preview.1 84 11/29/2025
0.1.0-preview 136 11/23/2025