Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

DistributedApplicationBuilder.AddDockerfileFactory

Method
📦 Aspire.Hosting v17.0.0
type DistributedApplicationBuilder interface {
// ... omitted for brevity
AddDockerfileFactory(
name string,
contextPath string,
dockerfileFactory func(arg DockerfileFactoryContext) string,
options ...*AddDockerfileFactoryOptions,
) ContainerResource
}

Signature

methodAddDockerfileFactorybuilder
Adds a Dockerfile to the application model that can be treated like a container resource, with the Dockerfile content generated by an asynchronous factory function.
AddDockerfileFactory(
name string,
contextPath string,
dockerfileFactory func(arg DockerfileFactoryContext) string,
options ...*AddDockerfileFactoryOptions,
) ContainerResource
namestringThe name of the resource.
contextPathstringPath to be used as the context for the container image build.
dockerfileFactoryfunc(arg DockerfileFactoryContext) stringcallbackAn asynchronous function that returns the Dockerfile content as a string.
options...*AddDockerfileFactoryOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AddDockerfileFactoryOptions argument.

Stage*stringThe stage representing the image to be published in a multi-stage Dockerfile.
ContainerResource

The resource builder.

Returns a handle; failures surface later via Err().

Defined on

This method is defined on the following type: