Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

ExecutableResource

Handle
📦 Aspire.Hosting v17.0.0

A resource that represents a specified executable process.

type ExecutableResource interface {
IComputeResource
Resource
ResourceWithArgs
ResourceWithEndpoints
ResourceWithEnvironment
ResourceWithWaitSupport
}

Methods

methodPublishAsDockerFilebuilder
Publishes an executable as a Docker file
PublishAsDockerFile(configure func(obj ContainerResource)) ExecutableResource
configurefunc(obj ContainerResource)callbackOptional action to configure the container resource
ExecutableResource

The resource builder.

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

Sets the command for the executable resource.
WithExecutableCommand(command string) ExecutableResource
commandstringCommand.
ExecutableResource

The resource builder.

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

Adds VS Code-compatible debug metadata for an executable resource.
WithExecutableDebugSupport(
launchConfigurationType string,
scriptPath string,
options ...*WithExecutableDebugSupportOptions,
) ExecutableResource
launchConfigurationTypestringThe launch configuration type understood by the extension.
scriptPathstringThe script path, relative to the executable working directory when not rooted.
options...*WithExecutableDebugSupportOptionsOptional settings, described under Options.

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

RuntimeExecutable*stringThe optional runtime executable to use in the launch configuration.
LaunchMethod*stringThe optional launch method to use in the launch configuration.
ExecutableResource

The resource builder.

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

methodWithVolumebuilder
Adds a volume to an executable resource.
WithVolume(
target string,
name string,
env string,
options ...*ExecutableResourceWithVolumeOptions,
) ExecutableResource
targetstringThe mount path inside the published container.
namestringThe volume name.
envstringThe environment variable that receives the effective volume path.
options...*ExecutableResourceWithVolumeOptionsOptional settings, described under Options.

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

IsReadOnly*boolWhether the published volume is read-only.
ExecutableResource

The same executable resource builder handle for chaining.

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

Sets the working directory for the executable resource.
WithWorkingDirectory(workingDirectory string) ExecutableResource
workingDirectorystringWorking directory.
ExecutableResource

The resource builder.

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