Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

DistributedApplicationBuilder.AddDockerfileBuilder

Method
📦 Aspire.Hosting v17.0.0
type DistributedApplicationBuilder interface {
// ... omitted for brevity
AddDockerfileBuilder(
name string,
contextPath string,
callback func(arg DockerfileBuilderCallbackContext),
options ...*AddDockerfileBuilderOptions,
) ContainerResource
}

Signature

methodAddDockerfileBuilderbuilder
Adds a container resource built from a programmatically generated Dockerfile
AddDockerfileBuilder(
name string,
contextPath string,
callback func(arg DockerfileBuilderCallbackContext),
options ...*AddDockerfileBuilderOptions,
) ContainerResource
namestringThe name of the resource.
contextPathstringPath to be used as the context for the container image build.
callbackfunc(arg DockerfileBuilderCallbackContext)callbackA callback that uses the DockerfileBuilder API to construct the Dockerfile.
options...*AddDockerfileBuilderOptionsOptional settings, described under Options.

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

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: