ExecutableResourceBuilderExtensions.PublishAsDockerFile<T> Method

Definition

Adds annotation to ExecutableResource to support containerization during deployment. The resulting container image is built, and when the optional buildArgs are provided they're used with docker build --build-arg.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> PublishAsDockerFile<T> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, System.Collections.Generic.IEnumerable<Aspire.Hosting.ApplicationModel.DockerBuildArg>? buildArgs = default) where T : Aspire.Hosting.ApplicationModel.ExecutableResource;
static member PublishAsDockerFile : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ExecutableResource)> * seq<Aspire.Hosting.ApplicationModel.DockerBuildArg> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ExecutableResource)> (requires 'T :> Aspire.Hosting.ApplicationModel.ExecutableResource)
<Extension()>
Public Function PublishAsDockerFile(Of T As ExecutableResource) (builder As IResourceBuilder(Of T), Optional buildArgs As IEnumerable(Of DockerBuildArg) = Nothing) As IResourceBuilder(Of T)

Type Parameters

T

Type of executable resource

Parameters

builder
IResourceBuilder<T>

Resource builder

buildArgs
IEnumerable<DockerBuildArg>

The optional build arguments, used with docker build --build-args.

Returns

A reference to the IResourceBuilder<T>.

Applies to