DockerVolume¶
Description¶
The DockerVolume object defines a Docker volume used to provide persistent storage to Docker containers. Most functionalities and modes are supported through the DockerObject.driver and DockerObject.options properties. See the official Docker documentation for more information on how to use Docker volumes.
› Inherits: | DockerObject |
---|
Properties¶
destination¶
This property holds the destination path where the volume is mounted in the container.
› Type: | String |
---|---|
› Signal: | destinationChanged() |
› Attributes: | Writable |
readOnly¶
This property holds whether this volume should be provided read-only for the container. Read-only volumes can be used to provide configuration files and other static data.
› Type: | Boolean |
---|---|
› Default: | false |
› Signal: | readOnlyChanged() |
› Attributes: | Writable |
Example¶
import InCore.Foundation 2.5
Application {
DockerService {
DockerContainer {
name: "docker-postgresql-example"
image: "arm32v7/postgres:alpine"
volumes: [ DockerVolume { name: "postgresdata"; destination: "/var/lib/postgresql/data" } ]
}
DockerContainer {
name: "docker-nodered-example"
image: "nodered/node-red:latest-minimal"
ports: [ "1880:1880" ]
volumes: [ DockerVolume { name: "nodereddata"; destination: "/data" } ]
}
}
}