Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithBindMount

Method
📦 Aspire.Hosting v17.0.0
func (ContainerResource) 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().

Applies to

This method applies to the following types: