Watch Aspire live streamsDocsTry Aspire

withDockerfile

Method
📦 Aspire.Hosting v13.6.0
interface ContainerResource {
// ... omitted for brevity
withDockerfile(
contextPath: string,
dockerfilePath?: string,
stage?: string): ContainerResource;
}

Signature

methodwithDockerfilebuilder
Causes Aspire to build the specified container image from a Dockerfile.
withDockerfile(
contextPath: string,
dockerfilePath?: string,
stage?: string): ContainerResource
contextPathstringPath to be used as the context for the container image build.
dockerfilePathstringoptionalPath to the Dockerfile relative to the `contextPath`. Defaults to "Dockerfile" if not specified.
stagestringoptionalThe stage representing the image to be published in a multi-stage Dockerfile.
ContainerResource

Applies to

This method applies to the following types: