dotnet
No long description provided.
Installation
dagger install github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10Entrypoint
Return Type
Dotnet ! Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
func (m *MyModule) Example() *dagger.Dotnet {
return dag.
Dotnet()
}@function
def example() -> dagger.Dotnet:
return (
dag.dotnet()
)@func()
example(): Dotnet {
return dag
.dotnet()
}Types
Dotnet 🔗
A Dagger module for .NET development with support for SDK, Runtime, and ASP.NET Core containers This module provides functions to work with official Microsoft .NET container images, supporting various base images (Alpine, Ubuntu, Debian, Mariner), versions, and customizations. Key features: - Multiple .NET versions (6, 7, 8, 9, 10) - SDK containers for building (including Native AOT SDK) - Runtime containers for production - Runtime-deps containers for Native AOT and self-contained apps - ASP.NET Core containers for web applications (including composite images) - Support for different base OS variants (Alpine, Ubuntu, Debian, Mariner, Chiseled, Distroless) - Native AOT compilation and deployment - Non-root user support for secure deployments - Customizable environment variables and configurations
sdk() 🔗
Returns a .NET SDK container for building applications
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | "10.0" | No description provided |
| baseImage | String | "debian" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
sdkfunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
Sdk()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.sdk()
)@func()
example(): Container {
return dag
.dotnet()
.sdk()
}runtime() 🔗
Returns a .NET Runtime container for running applications
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | "10.0" | No description provided |
| baseImage | String | "debian" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
runtimefunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
Runtime()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.runtime()
)@func()
example(): Container {
return dag
.dotnet()
.runtime()
}aspNet() 🔗
Returns an ASP.NET Core container for web applications
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | "10.0" | No description provided |
| baseImage | String | "debian" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
asp-netfunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
Aspnet()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.aspnet()
)@func()
example(): Container {
return dag
.dotnet()
.aspNet()
}runtimeDeps() 🔗
Returns a runtime-deps container with only OS dependencies (no .NET runtime) Ideal for Native AOT and self-contained deployments
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | "10.0" | No description provided |
| baseImage | String | "debian" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
runtime-depsfunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
Runtimedeps()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.runtimedeps()
)@func()
example(): Container {
return dag
.dotnet()
.runtimeDeps()
}runtimeDepsAot() 🔗
Returns a runtime-deps container optimized for Native AOT (minimal, no globalization) Available for Alpine, Mariner, and Ubuntu Chiseled
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | "10.0" | No description provided |
| baseImage | String | "jammy-chiseled" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
runtime-deps-aotfunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
Runtimedepsaot()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.runtimedepsaot()
)@func()
example(): Container {
return dag
.dotnet()
.runtimeDepsAot()
}runtimeDepsExtra() 🔗
Returns a runtime-deps container with globalization support (tzdata, ICU, stdc++) For Native AOT and Core CLR apps requiring globalization
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | "10.0" | No description provided |
| baseImage | String | "jammy-chiseled" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
runtime-deps-extrafunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
Runtimedepsextra()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.runtimedepsextra()
)@func()
example(): Container {
return dag
.dotnet()
.runtimeDepsExtra()
}aotSdk() 🔗
Returns a .NET SDK container with Native AOT tooling for building Native AOT applications These images are larger (typically 2x SDK size) but include required AOT compilation tools
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | "10.0" | No description provided |
| baseImage | String | "ubuntu" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
aot-sdkfunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
Aotsdk()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.aotsdk()
)@func()
example(): Container {
return dag
.dotnet()
.aotSdk()
}build() 🔗
Build a .NET application from source
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| configuration | String | "Release" | No description provided |
| version | String | "10.0" | No description provided |
| project | String | - | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
build --source DIR_PATHfunc (m *MyModule) Example(source *dagger.Directory) *dagger.Container {
return dag.
Dotnet().
Build(source)
}@function
def example(source: dagger.Directory) -> dagger.Container:
return (
dag.dotnet()
.build(source)
)@func()
example(source: Directory): Container {
return dag
.dotnet()
.build(source)
}publish() 🔗
Publish a .NET application ready for deployment
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| configuration | String | "Release" | No description provided |
| version | String | "10.0" | No description provided |
| project | String | - | No description provided |
| outputDir | String | "/publish" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
publish --source DIR_PATHfunc (m *MyModule) Example(source *dagger.Directory) *dagger.Container {
return dag.
Dotnet().
Publish(source)
}@function
def example(source: dagger.Directory) -> dagger.Container:
return (
dag.dotnet()
.publish(source)
)@func()
example(source: Directory): Container {
return dag
.dotnet()
.publish(source)
}publishNativeAot() 🔗
Publish a .NET application as Native AOT for minimal size and fast startup
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| rid | String ! | - | No description provided |
| configuration | String | "Release" | No description provided |
| version | String | "10.0" | No description provided |
| baseImage | String | "ubuntu" | No description provided |
| project | String | - | No description provided |
| outputDir | String | "/publish" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
publish-native-aot --source DIR_PATH --rid stringfunc (m *MyModule) Example(source *dagger.Directory, rid string) *dagger.Container {
return dag.
Dotnet().
Publishnativeaot(source, rid)
}@function
def example(source: dagger.Directory, rid: str) -> dagger.Container:
return (
dag.dotnet()
.publishnativeaot(source, rid)
)@func()
example(source: Directory, rid: string): Container {
return dag
.dotnet()
.publishNativeAot(source, rid)
}publishNativeAotContainer() 🔗
Create a production-ready Native AOT application container
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| entrypoint | String ! | - | No description provided |
| rid | String ! | - | No description provided |
| version | String | "10.0" | No description provided |
| baseImage | String | "jammy-chiseled" | No description provided |
| useAotVariant | Boolean | true | No description provided |
| configuration | String | "Release" | No description provided |
| project | String | - | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
publish-native-aot-container --source DIR_PATH --entrypoint string --rid stringfunc (m *MyModule) Example(source *dagger.Directory, entrypoint string, rid string) *dagger.Container {
return dag.
Dotnet().
Publishnativeaotcontainer(source, entrypoint, rid)
}@function
def example(source: dagger.Directory, entrypoint: str, rid: str) -> dagger.Container:
return (
dag.dotnet()
.publishnativeaotcontainer(source, entrypoint, rid)
)@func()
example(source: Directory, entrypoint: string, rid: string): Container {
return dag
.dotnet()
.publishNativeAotContainer(source, entrypoint, rid)
}publishContainer() 🔗
Create a production-ready .NET application container
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| entrypoint | String ! | - | No description provided |
| version | String | "10.0" | No description provided |
| baseImage | String | "debian" | No description provided |
| configuration | String | "Release" | No description provided |
| project | String | - | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
publish-container --source DIR_PATH --entrypoint stringfunc (m *MyModule) Example(source *dagger.Directory, entrypoint string) *dagger.Container {
return dag.
Dotnet().
Publishcontainer(source, entrypoint)
}@function
def example(source: dagger.Directory, entrypoint: str) -> dagger.Container:
return (
dag.dotnet()
.publishcontainer(source, entrypoint)
)@func()
example(source: Directory, entrypoint: string): Container {
return dag
.dotnet()
.publishContainer(source, entrypoint)
}publishAspNetContainer() 🔗
Create a production-ready ASP.NET Core application container
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| entrypoint | String ! | - | No description provided |
| version | String | "10.0" | No description provided |
| baseImage | String | "debian" | No description provided |
| configuration | String | "Release" | No description provided |
| project | String | - | No description provided |
| port | Integer | 8080 | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
publish-asp-net-container --source DIR_PATH --entrypoint stringfunc (m *MyModule) Example(source *dagger.Directory, entrypoint string) *dagger.Container {
return dag.
Dotnet().
Publishaspnetcontainer(source, entrypoint)
}@function
def example(source: dagger.Directory, entrypoint: str) -> dagger.Container:
return (
dag.dotnet()
.publishaspnetcontainer(source, entrypoint)
)@func()
example(source: Directory, entrypoint: string): Container {
return dag
.dotnet()
.publishAspNetContainer(source, entrypoint)
}test() 🔗
Run .NET tests in a container
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| version | String | "10.0" | No description provided |
| project | String | - | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
test --source DIR_PATHfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory) string {
return dag.
Dotnet().
Test(ctx, source)
}@function
async def example(source: dagger.Directory) -> str:
return await (
dag.dotnet()
.test(source)
)@func()
async example(source: Directory): Promise<string> {
return dag
.dotnet()
.test(source)
}restore() 🔗
Restore NuGet packages for a .NET project
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| version | String | "10.0" | No description provided |
| project | String | - | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
restore --source DIR_PATHfunc (m *MyModule) Example(source *dagger.Directory) *dagger.Container {
return dag.
Dotnet().
Restore(source)
}@function
def example(source: dagger.Directory) -> dagger.Container:
return (
dag.dotnet()
.restore(source)
)@func()
example(source: Directory): Container {
return dag
.dotnet()
.restore(source)
}withEnvironment() 🔗
Create a custom .NET container with environment variables
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseContainer | Container ! | - | No description provided |
| envVars | [String ! ] ! | - | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
with-environment --base-container IMAGE:TAG --env-vars string1 --env-vars string2func (m *MyModule) Example(baseContainer *dagger.Container, envVars []string) *dagger.Container {
return dag.
Dotnet().
Withenvironment(baseContainer, envVars)
}@function
def example(basecontainer: dagger.Container, envvars: List[str]) -> dagger.Container:
return (
dag.dotnet()
.withenvironment(basecontainer, envvars)
)@func()
example(baseContainer: Container, envVars: string[]): Container {
return dag
.dotnet()
.withEnvironment(baseContainer, envVars)
}chiseledRuntime() 🔗
Get a chiseled Ubuntu .NET runtime container (minimal, secure, non-root)
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | "10.0" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
chiseled-runtimefunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
Chiseledruntime()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.chiseledruntime()
)@func()
example(): Container {
return dag
.dotnet()
.chiseledRuntime()
}chiseledAspNet() 🔗
Get a chiseled Ubuntu ASP.NET Core container (minimal, secure, non-root)
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | "10.0" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
chiseled-asp-netfunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
Chiseledaspnet()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.chiseledaspnet()
)@func()
example(): Container {
return dag
.dotnet()
.chiseledAspNet()
}aspNetComposite() 🔗
Get an ASP.NET Core composite container with pre-compiled R2R assemblies Composite images offer faster startup and smaller size. Available for Alpine, Ubuntu Chiseled, and Mariner Distroless
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | "10.0" | No description provided |
| baseImage | String | "jammy-chiseled" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
asp-net-compositefunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
Aspnetcomposite()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.aspnetcomposite()
)@func()
example(): Container {
return dag
.dotnet()
.aspNetComposite()
}distrolessRuntime() 🔗
Get a Mariner distroless .NET runtime container (minimal, no shell/package manager)
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | "10.0" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
distroless-runtimefunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
Distrolessruntime()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.distrolessruntime()
)@func()
example(): Container {
return dag
.dotnet()
.distrolessRuntime()
}distrolessAspNet() 🔗
Get a Mariner distroless ASP.NET Core container (minimal, no shell/package manager)
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | "10.0" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
distroless-asp-netfunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
Distrolessaspnet()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.distrolessaspnet()
)@func()
example(): Container {
return dag
.dotnet()
.distrolessAspNet()
}chiseledExtra() 🔗
Get a chiseled Ubuntu runtime-deps container with globalization support (extra variant) Includes tzdata, ICU, and stdc++ for apps requiring globalization
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | "10.0" | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
chiseled-extrafunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
Chiseledextra()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.chiseledextra()
)@func()
example(): Container {
return dag
.dotnet()
.chiseledExtra()
}withNonRootUser() 🔗
Configure a container to run as the non-root ‘app’ user (UID 1654) Recommended for security in production deployments. Requires app to run on port 8080 or higher
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseContainer | Container ! | - | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
with-non-root-user --base-container IMAGE:TAGfunc (m *MyModule) Example(baseContainer *dagger.Container) *dagger.Container {
return dag.
Dotnet().
Withnonrootuser(baseContainer)
}@function
def example(basecontainer: dagger.Container) -> dagger.Container:
return (
dag.dotnet()
.withnonrootuser(basecontainer)
)@func()
example(baseContainer: Container): Container {
return dag
.dotnet()
.withNonRootUser(baseContainer)
}withNonRootUserUid() 🔗
Configure a container to run as the non-root ‘app’ user by UID (1654) Useful for Kubernetes runAsNonRoot test which requires UID-based user specification
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseContainer | Container ! | - | No description provided |
Example
dagger -m github.com/pjmagee/daggerverse/dotnet@1639bea6e8e40bcf5839d816525f4491f0c53e10 call \
with-non-root-user-uid --base-container IMAGE:TAGfunc (m *MyModule) Example(baseContainer *dagger.Container) *dagger.Container {
return dag.
Dotnet().
Withnonrootuseruid(baseContainer)
}@function
def example(basecontainer: dagger.Container) -> dagger.Container:
return (
dag.dotnet()
.withnonrootuseruid(basecontainer)
)@func()
example(baseContainer: Container): Container {
return dag
.dotnet()
.withNonRootUserUid(baseContainer)
}