ContainerMountCollection Class
A collection of mounts attached to a container.
public sealed class ContainerMountCollection : IEnumerable<IMount>, IEnumerable- Implements
Properties
| Name | Description |
|---|---|
| Count | Gets the number of mounts in the collection. |
Methods
| Name | Description |
|---|---|
| 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() |
Add(IMount)
ContainerMountCollection.csAddBindMount(string, string, bool)
ContainerMountCollection.csAddTmpfs overloads
AddTmpfs(string)
ContainerMountCollection.csAddTmpfs(string, long?, UnixFileMode?)
ContainerMountCollection.csAdds a tmpfs (in-memory) mount with options.
public void AddTmpfs(string containerPath, long? size, UnixFileMode? mode = null)Parameters
containerPathstring- The path inside the container.
sizelong?- The maximum size of the mount, in bytes, or
nullto keep the default of the runtime. modeUnixFileMode?- The permissions of the root of the mount, or
nullto keep the default of the runtime.
AddVolume overloads
AddVolume(TemporaryVolume, string, bool)
ContainerMountCollection.csAdds 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
volumeTemporaryVolume- The volume to mount.
containerPathstring- The path inside the container.
readOnlybool- Whether the mount is read-only.
AddVolume(string, string)
ContainerMountCollection.csAddVolume(string, string, bool)
ContainerMountCollection.csGetEnumerator()
ContainerMountCollection.csReturns an enumerator over the mounts.
public IEnumerator<IMount> GetEnumerator()Returns
IEnumerator<IMount> An enumerator.