Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithDockerfileBuilder

Method
📦 Aspire.Hosting v17.0.0
func (ContainerResource) WithDockerfileBuilder(
contextPath string,
callback func(arg DockerfileBuilderCallbackContext),
options ...*WithDockerfileBuilderOptions,
) ContainerResource

Signature

methodWithDockerfileBuilderbuilder
Configures the resource to use a programmatically generated Dockerfile
WithDockerfileBuilder(
contextPath string,
callback func(arg DockerfileBuilderCallbackContext),
options ...*WithDockerfileBuilderOptions,
) ContainerResource
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...*WithDockerfileBuilderOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithDockerfileBuilderOptions 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().

Applies to

This method applies to the following types: