DockerMount¶
Description¶
The DockerMount object defines a Docker mount used to mount directories from the host system into Docker containers. Most functionalities and modes are supported through the DockerObject.driver and DockerObject.options properties. See the official Docker documentation on bind mounts and tmpfs mounts for more information on how to use Docker mounts.
› Inherits: | Object |
---|
Properties¶
autoCreate¶
This property holds whether the source directory should be created automatically if it does not exist.
› Type: | Boolean |
---|---|
› Default: | true |
› Signal: | autoCreateChanged() |
› Attributes: | Writable |
destination¶
This property holds an absolute path to use as mount point inside the container. All contents if the source directory will be available in this directory in the container.
› Type: | String |
---|---|
› Signal: | destinationChanged() |
› Attributes: | Writable |
readOnly¶
This property holds whether to mount the source directory read-only into the container. This can be used as an additional security measure if the container does not need to write to the mount anyway.
› Type: | Boolean |
---|---|
› Default: | false |
› Signal: | readOnlyChanged() |
› Attributes: | Writable |
source¶
This property holds an absolute path to the source directory which to mount into the container. If storage is set, storageSubDirectory has to be used instead.
› Type: | String |
---|---|
› Signal: | sourceChanged() |
› Attributes: | Writable |
storage¶
This property holds the storage of which a sub directory shall be mounted into the container.
› Type: | Storage |
---|---|
› Signal: | storageChanged() |
› Attributes: | Writable |
Example¶
import InCore.Foundation 2.5
Application {
System {
DockerService {
DockerContainer {
name: "docker-mount-example"
image: "arm32v7/nginx:latest"
mounts: [
DockerMount {
source: "/storage/nginx/conf.d"
destination: "/etc/nginx/conf.d"
readOnly: true
}
]
}
}
}
}