dotnet
No long description provided.
Installation
dagger install github.com/pjmagee/daggerverse/dotnet@b57c6e7ce43ca1cd4ce9c0eec16ef59a5923fe49Entrypoint
Return Type
Dotnet Example
dagger -m github.com/pjmagee/daggerverse/dotnet@b57c6e7ce43ca1cd4ce9c0eec16ef59a5923fe49 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 - Runtime containers for production - ASP.NET Core containers for web applications - Support for different base OS variants (Alpine, Ubuntu, Debian, Mariner, Chiseled) - 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@b57c6e7ce43ca1cd4ce9c0eec16ef59a5923fe49 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@b57c6e7ce43ca1cd4ce9c0eec16ef59a5923fe49 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@b57c6e7ce43ca1cd4ce9c0eec16ef59a5923fe49 call \
asp-netfunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
AspNet()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.asp_net()
)@func()
example(): Container {
return dag
.dotnet()
.aspNet()
}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@b57c6e7ce43ca1cd4ce9c0eec16ef59a5923fe49 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@b57c6e7ce43ca1cd4ce9c0eec16ef59a5923fe49 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)
}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@b57c6e7ce43ca1cd4ce9c0eec16ef59a5923fe49 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()
.publish_container(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@b57c6e7ce43ca1cd4ce9c0eec16ef59a5923fe49 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()
.publish_asp_net_container(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@b57c6e7ce43ca1cd4ce9c0eec16ef59a5923fe49 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@b57c6e7ce43ca1cd4ce9c0eec16ef59a5923fe49 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@b57c6e7ce43ca1cd4ce9c0eec16ef59a5923fe49 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(base_container: dagger.Container, env_vars: List[str]) -> dagger.Container:
return (
dag.dotnet()
.with_environment(base_container, env_vars)
)@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@b57c6e7ce43ca1cd4ce9c0eec16ef59a5923fe49 call \
chiseled-runtimefunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
ChiseledRuntime()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.chiseled_runtime()
)@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@b57c6e7ce43ca1cd4ce9c0eec16ef59a5923fe49 call \
chiseled-asp-netfunc (m *MyModule) Example() *dagger.Container {
return dag.
Dotnet().
ChiseledAspNet()
}@function
def example() -> dagger.Container:
return (
dag.dotnet()
.chiseled_asp_net()
)@func()
example(): Container {
return dag
.dotnet()
.chiseledAspNet()
}