Share via


Service.Volumes Property

Definition

Defines the list of volumes to be mounted into the service's container.

[YamlDotNet.Serialization.YamlMember(Alias="volumes", DefaultValuesHandling=YamlDotNet.Serialization.DefaultValuesHandling.OmitEmptyCollections)]
public System.Collections.Generic.List<Aspire.Hosting.Docker.Resources.ServiceNodes.Volume> Volumes { get; set; }
[<YamlDotNet.Serialization.YamlMember(Alias="volumes", DefaultValuesHandling=YamlDotNet.Serialization.DefaultValuesHandling.OmitEmptyCollections)>]
member this.Volumes : System.Collections.Generic.List<Aspire.Hosting.Docker.Resources.ServiceNodes.Volume> with get, set
Public Property Volumes As List(Of Volume)

Property Value

Attributes
YamlDotNet.Serialization.YamlMemberAttribute

Remarks

Volumes provide a mechanism for persisting data used by the service or for sharing data between the host and the container. Each volume entry maps a source path on the host or an anonymous volume to a target path within the container. This property can also include named volumes as defined in the Compose file's top-level `volumes` section. Volumes can specify additional options such as read-only access or volume drivers.

Applies to