Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithVolume

Method
📦 Aspire.Hosting v17.0.0
func (ProjectResource) WithVolume(
target string,
name string,
env string,
options ...*ProjectResourceWithVolumeOptions,
) ProjectResource

Signature

methodWithVolumebuilder
Adds a volume to a project resource.
WithVolume(
target string,
name string,
env string,
options ...*ProjectResourceWithVolumeOptions,
) ProjectResource
targetstringThe mount path inside the published container.
namestringThe volume name.
envstringThe environment variable that receives the effective volume path.
options...*ProjectResourceWithVolumeOptionsOptional settings, described under Options.

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

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

The same project resource builder handle for chaining.

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

Applies to

This method applies to the following types: