Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

AddDockerfile

Method
📦 Aspire.Hosting v17.0.0
func (DistributedApplicationBuilder) 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().

Applies to

This method applies to the following types: