Watch Aspire live streamsDocsTry Aspire

addDockerfileBuilder

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

Signature

methodaddDockerfileBuilderbuilder
Adds a container resource built from a programmatically generated Dockerfile
addDockerfileBuilder(name: string, contextPath: string, callback: (arg: DockerfileBuilderCallbackContext) => Promise<void>, stage?: string): ContainerResource
namestringThe name of the resource.
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: