Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

ExecutableResource.WithVolume

Method
📦 Aspire.Hosting v17.0.0
type ExecutableResource interface {
// ... omitted for brevity
WithVolume(
target string,
name string,
env string,
options ...*ExecutableResourceWithVolumeOptions,
) ExecutableResource
}

Signature

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().

Defined on

This method is defined on the following type: