Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

ContainerResource.WithBindMount

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

Signature

methodWithBindMountbuilder
Adds a bind mount to a container resource.
WithBindMount(
source string,
target string,
options ...*WithBindMountOptions,
) ContainerResource
sourcestringThe source path of the mount. This is the path to the file or directory on the host, relative to the AppHost project directory.
targetstringThe target path where the file or directory is mounted in the container.
options...*WithBindMountOptionsOptional settings, described under Options.

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

IsReadOnly*boolA flag that indicates if this is a read-only mount.
ContainerResource

The resource builder.

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

Defined on

This method is defined on the following type: