Share via


ContainerResourceBuilderExtensions.WithContainerRuntimeArgs Method

Definition

Overloads

WithContainerRuntimeArgs<T>(IResourceBuilder<T>, String[])

Adds a callback to be executed with a list of arguments to add to the container runtime run command when a container resource is started.

WithContainerRuntimeArgs<T>(IResourceBuilder<T>, Func<ContainerRuntimeArgsCallbackContext,Task>)

Adds a callback to be executed with a list of arguments to add to the container runtime run command when a container resource is started.

WithContainerRuntimeArgs<T>(IResourceBuilder<T>, Action<ContainerRuntimeArgsCallbackContext>)

Adds a callback to be executed with a list of arguments to add to the container runtime run command when a container resource is started.

WithContainerRuntimeArgs<T>(IResourceBuilder<T>, String[])

Source:
ContainerResourceBuilderExtensions.cs

Adds a callback to be executed with a list of arguments to add to the container runtime run command when a container resource is started.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithContainerRuntimeArgs<T> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, params string[] args) where T : Aspire.Hosting.ApplicationModel.ContainerResource;
static member WithContainerRuntimeArgs : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)> * string[] -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)> (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)
<Extension()>
Public Function WithContainerRuntimeArgs(Of T As ContainerResource) (builder As IResourceBuilder(Of T), ParamArray args As String()) As IResourceBuilder(Of T)

Type Parameters

T

The resource type.

Parameters

builder
IResourceBuilder<T>

Builder for the container resource.

args
String[]

The arguments to be passed to the container runtime run command when the container resource is started.

Returns

The IResourceBuilder<T>.

Remarks

This is intended to pass additional arguments to the underlying container runtime run command to enable advanced features such as exposing GPUs to the container. To pass runtime arguments to the actual container, use the WithArgs<T>(IResourceBuilder<T>, String[]) method.

Applies to

WithContainerRuntimeArgs<T>(IResourceBuilder<T>, Func<ContainerRuntimeArgsCallbackContext,Task>)

Source:
ContainerResourceBuilderExtensions.cs

Adds a callback to be executed with a list of arguments to add to the container runtime run command when a container resource is started.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithContainerRuntimeArgs<T> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, Func<Aspire.Hosting.ApplicationModel.ContainerRuntimeArgsCallbackContext,System.Threading.Tasks.Task> callback) where T : Aspire.Hosting.ApplicationModel.ContainerResource;
static member WithContainerRuntimeArgs : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)> * Func<Aspire.Hosting.ApplicationModel.ContainerRuntimeArgsCallbackContext, System.Threading.Tasks.Task> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)> (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)
<Extension()>
Public Function WithContainerRuntimeArgs(Of T As ContainerResource) (builder As IResourceBuilder(Of T), callback As Func(Of ContainerRuntimeArgsCallbackContext, Task)) As IResourceBuilder(Of T)

Type Parameters

T

The resource type.

Parameters

builder
IResourceBuilder<T>

Builder for the container resource.

callback
Func<ContainerRuntimeArgsCallbackContext,Task>

A callback that allows for deferred execution for computing arguments. This runs after resources have been allocation by the orchestrator and allows access to other resources to resolve computed data, e.g. connection strings, ports.

Returns

The IResourceBuilder<T>.

Remarks

This is intended to pass additional arguments to the underlying container runtime run command to enable advanced features such as exposing GPUs to the container. To pass runtime arguments to the actual container, use the WithArgs<T>(IResourceBuilder<T>, Func<CommandLineArgsCallbackContext,Task>) method.

Applies to

WithContainerRuntimeArgs<T>(IResourceBuilder<T>, Action<ContainerRuntimeArgsCallbackContext>)

Source:
ContainerResourceBuilderExtensions.cs

Adds a callback to be executed with a list of arguments to add to the container runtime run command when a container resource is started.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithContainerRuntimeArgs<T> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, Action<Aspire.Hosting.ApplicationModel.ContainerRuntimeArgsCallbackContext> callback) where T : Aspire.Hosting.ApplicationModel.ContainerResource;
static member WithContainerRuntimeArgs : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)> * Action<Aspire.Hosting.ApplicationModel.ContainerRuntimeArgsCallbackContext> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)> (requires 'T :> Aspire.Hosting.ApplicationModel.ContainerResource)
<Extension()>
Public Function WithContainerRuntimeArgs(Of T As ContainerResource) (builder As IResourceBuilder(Of T), callback As Action(Of ContainerRuntimeArgsCallbackContext)) As IResourceBuilder(Of T)

Type Parameters

T

Parameters

builder
IResourceBuilder<T>

Builder for the container resource.

callback
Action<ContainerRuntimeArgsCallbackContext>

A callback that allows for deferred execution for computing arguments. This runs after resources have been allocation by the orchestrator and allows access to other resources to resolve computed data, e.g. connection strings, ports.

Returns

The IResourceBuilder<T>.

Remarks

This is intended to pass additional arguments to the underlying container runtime run command to enable advanced features such as exposing GPUs to the container. To pass runtime arguments to the actual container, use the WithArgs<T>(IResourceBuilder<T>, Action<CommandLineArgsCallbackContext>) method.

Applies to