Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithDockerfileFactory

Method
📦 Aspire.Hosting v17.0.0
func (ContainerResource) WithDockerfileFactory(
contextPath string,
dockerfileFactory func(arg DockerfileFactoryContext) string,
options ...*WithDockerfileFactoryOptions,
) ContainerResource

Signature

methodWithDockerfileFactorybuilder
Builds the specified container image from a Dockerfile generated by an asynchronous factory function.
WithDockerfileFactory(
contextPath string,
dockerfileFactory func(arg DockerfileFactoryContext) string,
options ...*WithDockerfileFactoryOptions,
) ContainerResource
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...*WithDockerfileFactoryOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithDockerfileFactoryOptions 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().

Applies to

This method applies to the following types: