Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

DistributedApplicationBuilder.AddDockerfile

Method
📦 Aspire.Hosting v17.0.0
type DistributedApplicationBuilder interface {
// ... omitted for brevity
AddDockerfile(
name string,
contextPath string,
options ...*AddDockerfileOptions,
) ContainerResource
}

Signature

methodAddDockerfilebuilder
Adds a Dockerfile to the application model that can be treated like a container resource.
AddDockerfile(
name string,
contextPath string,
options ...*AddDockerfileOptions,
) ContainerResource
namestringThe name of the resource.
contextPathstringPath to be used as the context for the container image build.
options...*AddDockerfileOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AddDockerfileOptions argument.

DockerfilePath*stringPath to the Dockerfile relative to the contextPath. Defaults to "Dockerfile" if not specified.
Stage*stringThe stage representing the image to be published in a multi-stage Dockerfile.
ContainerResource

The resource builder.

Returns a handle; failures surface later via Err().

Defined on

This method is defined on the following type: