ContainerMountCollection Class

A collection of mounts attached to a container.

public sealed class ContainerMountCollection : IEnumerable<IMount>, IEnumerable
Implements

Properties

NameDescription
CountGets the number of mounts in the collection.

Gets the number of mounts in the collection.

public int Count { get; }

Property value

int

Methods

NameDescription
Add(IMount)Adds a mount.
AddBindMount(string, string, bool)Adds a bind mount that maps a host path into the container.
AddTmpfs(string)Adds a tmpfs (in-memory) mount.
AddTmpfs(string, long?, UnixFileMode?)Adds a tmpfs (in-memory) mount with options.
AddVolume(TemporaryVolume, string, bool)Adds a mount for a TemporaryVolume. The volume is created, if needed, when the container is created.
AddVolume(string, string)Adds a named volume mount.
AddVolume(string, string, bool)Adds a named volume mount.
GetEnumerator()Returns an enumerator over the mounts.
System.Collections.IEnumerable.GetEnumerator()

Adds a mount.

public void Add(IMount mount)

Parameters

mount IMount
The mount to add.

AddBindMount(string, string, bool)

ContainerMountCollection.cs

Adds a bind mount that maps a host path into the container.

public void AddBindMount(string hostPath, string containerPath, bool readOnly = false)

Parameters

hostPath string
The path on the host.
containerPath string
The path inside the container.
readOnly bool
Whether the mount is read-only.

AddTmpfs overloads

Adds a tmpfs (in-memory) mount.

public void AddTmpfs(string containerPath)
Parameters
containerPath string
The path inside the container.

AddTmpfs(string, long?, UnixFileMode?)

ContainerMountCollection.cs

Adds a tmpfs (in-memory) mount with options.

public void AddTmpfs(string containerPath, long? size, UnixFileMode? mode = null)
Parameters
containerPath string
The path inside the container.
size long?
The maximum size of the mount, in bytes, or null to keep the default of the runtime.
mode UnixFileMode?
The permissions of the root of the mount, or null to keep the default of the runtime.

AddVolume overloads

AddVolume(TemporaryVolume, string, bool)

ContainerMountCollection.cs

Adds a mount for a TemporaryVolume. The volume is created, if needed, when the container is created.

public void AddVolume(TemporaryVolume volume, string containerPath, bool readOnly = false)
Parameters
volume TemporaryVolume
The volume to mount.
containerPath string
The path inside the container.
readOnly bool
Whether the mount is read-only.

AddVolume(string, string)

ContainerMountCollection.cs

Adds a named volume mount.

public void AddVolume(string volumeName, string containerPath)
Parameters
volumeName string
The volume name.
containerPath string
The path inside the container.

AddVolume(string, string, bool)

ContainerMountCollection.cs

Adds a named volume mount.

public void AddVolume(string volumeName, string containerPath, bool readOnly)
Parameters
volumeName string
The volume name.
containerPath string
The path inside the container.
readOnly bool
Whether the mount is read-only.

Returns an enumerator over the mounts.

public IEnumerator<IMount> GetEnumerator()

Returns

IEnumerator<IMount> An enumerator.

System.Collections.IEnumerable.GetEnumerator()

ContainerMountCollection.cs
IEnumerator IEnumerable.GetEnumerator()

No documentation is available.