feat: support read-only volume annotations
All checks were successful
/ build (push) Successful in 53s
All checks were successful
/ build (push) Successful in 53s
This commit is contained in:
parent
c1094c7020
commit
2ce774a249
2 changed files with 12 additions and 5 deletions
|
@ -93,6 +93,8 @@ func CreateContainer(definition service_definition.ContainerDefinition, knownVol
|
|||
|
||||
for _, volume := range definition.Volumes {
|
||||
var host string
|
||||
var suffix string
|
||||
|
||||
container := volume.Container
|
||||
|
||||
if volume.Name != "" {
|
||||
|
@ -104,7 +106,11 @@ func CreateContainer(definition service_definition.ContainerDefinition, knownVol
|
|||
log.Fatal("Invalid volume source configuration")
|
||||
}
|
||||
|
||||
arg := []string{"-v", host + ":" + container}
|
||||
if volume.ReadOnly == true {
|
||||
suffix = ":ro"
|
||||
}
|
||||
|
||||
arg := []string{"-v", host + ":" + container + suffix}
|
||||
|
||||
args = append(args, arg...)
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ type VolumeConfiguration struct {
|
|||
Name string `yaml:"name"`
|
||||
Container string `yaml:"container"`
|
||||
Host string `yaml:"host"`
|
||||
ReadOnly bool `yaml:"readonly"`
|
||||
}
|
||||
|
||||
type ContainerDefinition struct {
|
||||
|
|
Loading…
Reference in a new issue