Volume
Last updated
Last updated
A volume type allows the specification of an attached volume.
Attributes are the properties of a resource that can be used to configure it.
Source source
required
string
The source volume to mount in the container, can be specified as a relative `./` or absolute path `/usr/local/bin`. Relative paths are relative to the file declaring the container.
Destination destination
required
string
The destination in the container to mount the volume to, must be an absolute path.
Type type
string
The type of the mount, can be one of the following values:
bind: bind the source path to the destination path in the container
volume: source is a Docker volume
tmpfs: create a temporary filesystem
ReadOnly read_only
bool
BindPropagation bind_propagation
string
Configures bind propagation for Docker volume mounts, only applies to bind mounts, can be one of the following values:
shared
slave
private
rslave
rprivate
For more information please see the Docker documentation https://docs.docker.com/storage/bind-mounts/#configure-bind-propagation
BindPropagationNonRecursive bind_propagation_non_recursive
bool
Configures recursiveness of the bind mount.
By default Docker mounts with the equivalent of mount --rbind
meaning that mounts below the the source directory are visible in the container. or instance running docker run --rm --mount type=bind,src=/,target=/host,readonly
busybox will make /run
of the host available as /host/run
in the container. To make matters even worse it will be writable (since only the toplevel bind is set readonly, not the children).
If bind_propagation_non_recursive
is set to true then the container will only see an empty /host/run
, meaning the tmpfs
which is typically mounted to /run
on the host is not propagated into the container.
SelinuxRelabel selinux_relabel
string
Configures Selinux relabeling for the container (usually specified as :z or :Z) and can be one of the following values:
shared (Equivalent to :z)
private (Equivalent to :Z)
These attributes are computed when the config is parsed and applied, and are therefor only known at parsetime or runtime.
Meta ID meta.id
string
The full ID of the resource e.g. `resource.type.name`. This is computed from the full resource path:
Meta Type meta.type
string
The type of the resource. This taken from the type label of the resource definition.
Meta Name meta.name
string
The name of the resource. This taken from the name label of the resource definition.