addDockerfile

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

Signature

methodaddDockerfilebuilder
Adds a Dockerfile to the application model that can be treated like a container resource.
addDockerfile(
name: string,
contextPath: string,
dockerfilePath?: string,
stage?: string): ContainerResource
namestringThe name of the resource.
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: