Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

ContainerResource.WithVolume

Method
📦 Aspire.Hosting v17.0.0
type ContainerResource interface {
// ... omitted for brevity
WithVolume(
target string,
options ...*WithVolumeOptions,
) ContainerResource
}

Signature

methodWithVolumebuilder
Adds a volume to a container resource.
WithVolume(
target string,
options ...*WithVolumeOptions,
) ContainerResource
targetstringThe mount path inside the container.
options...*WithVolumeOptionsOptional settings, described under Options.

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

Name*stringThe volume name. If null, an anonymous volume is created.
IsReadOnly*boolWhether the volume is read-only.
ContainerResource

The same resource builder handle for chaining.

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

Defined on

This method is defined on the following type: