Class VolumeMount
- Namespace
- Bielu.Microservices.Orchestrator.Models
- Assembly
- Bielu.Microservices.Orchestrator.dll
Represents a volume mount that maps a host path (or named volume) into a container path.
public class VolumeMount
- Inheritance
-
VolumeMount
- Inherited Members
Properties
ContainerPath
The path inside the container where the volume will be mounted.
public string ContainerPath { get; set; }
Property Value
HostPath
The path on the host machine, or the name of a named volume.
public string HostPath { get; set; }
Property Value
IsBindMount
Returns true when HostPath is a host filesystem path (bind mount)
rather than a named volume. Rooted paths (/data, C:\data) and relative
paths (./data) are treated as bind mounts; plain names (myvolume) are not.
public bool IsBindMount { get; }
Property Value
LocalDriverOptions
When set, the container manager will auto-create a local-driver bound volume with these options before starting the container. HostPath is used as the volume name; Device is the host path.
public LocalVolumeOptions? LocalDriverOptions { get; set; }
Property Value
ReadOnly
Whether the mount is read-only. Defaults to false.
public bool ReadOnly { get; set; }
Property Value
Methods
Parse(string)
Parses a Docker-style volume binding string in the form
host:container or host:container:ro|rw.
public static VolumeMount Parse(string binding)
Parameters
bindingstringThe binding string to parse.
Returns
- VolumeMount
The parsed VolumeMount.
Exceptions
- ArgumentException
Thrown if the string is null, empty, or malformed.
ToBindString()
Serializes the volume mount into the Docker-style host:container[:ro] format.
public string ToBindString()
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.