Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

ContainerResource.WithDockerfile

Method
📦 Aspire.Hosting v17.0.0
type ContainerResource interface {
// ... omitted for brevity
WithDockerfile(
contextPath string,
options ...*WithDockerfileOptions,
) ContainerResource
}

Signature

methodWithDockerfilebuilder
Causes Aspire to build the specified container image from a Dockerfile.
WithDockerfile(
contextPath string,
options ...*WithDockerfileOptions,
) ContainerResource
contextPathstringPath to be used as the context for the container image build.
options...*WithDockerfileOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithDockerfileOptions 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: