Watch Aspire live streamsDocsTry Aspire

withDockerfileBuilder

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

Signature

methodwithDockerfileBuilderbuilder
Configures the resource to use a programmatically generated Dockerfile
withDockerfileBuilder(contextPath: string, callback: (arg: DockerfileBuilderCallbackContext) => Promise<void>, stage?: string): ContainerResource
contextPathstringPath to be used as the context for the container image build.
callback(arg: DockerfileBuilderCallbackContext) => Promise<void>A callback that uses the `DockerfileBuilder` API to construct the Dockerfile.
stagestringoptionalThe stage representing the image to be published in a multi-stage Dockerfile.
ContainerResource

Applies to

This method applies to the following types: