Skip to content

Container model reference


Mount

This represents mount configuration for a container.

type

type: Literal['bind', 'volume']

The type of mount, either bind or volume.

path

path: str

The path where the file or directory is mounted in the container.

source

source: str | None = None

For bind mounts, this is the path to the file or directory on the host. For volume mounts, this is the name of the volume. Anonymous volumes must not set this.

read_only

read_only: bool = False

Whether the mount is read-only.

volume_options

volume_options: dict[str, str] = {}

Additional options for the volume mounts.

as_csv

as_csv() -> str

This returns a CSV representation of the mount configuration. This can be used directly by the --mount flag of the docker run command.