withDockerfileFactory

Method
📦 Aspire.Hosting v17.0.0
interface ContainerResource {
// ... omitted for brevity
withDockerfileFactory(
contextPath: string,
dockerfileFactory: callback,
stage?: string): ContainerResource;
}

Signature

methodwithDockerfileFactorybuilder
Builds the specified container image from a Dockerfile generated by an asynchronous factory function.
withDockerfileFactory(contextPath: string, dockerfileFactory: (arg: DockerfileFactoryContext) => Promise<string>, stage?: string): ContainerResource
contextPathstringPath to be used as the context for the container image build.
dockerfileFactory(arg: DockerfileFactoryContext) => Promise<string>An asynchronous function that returns the Dockerfile content as a string.
stagestringoptionalThe stage representing the image to be published in a multi-stage Dockerfile.
ContainerResource

Applies to

This method applies to the following types: