feat: allow network, pid in container definitions #4

Merged
marc merged 1 commit from feat/support-for-network-and-pid-config into main 2024-11-09 23:19:09 +00:00
2 changed files with 15 additions and 5 deletions

View file

@ -96,6 +96,14 @@ func CreateContainer(definition service_definition.ContainerDefinition, knownVol
"--replace",
}
if definition.Network != "" {
args = append(args, []string{"--network", definition.Network}...)
}
if definition.PIDNamespace != "" {
args = append(args, []string{"--pid", definition.PIDNamespace}...)
}
if definition.EnvFile != "" {
args = append(args, []string{"--env-file", definition.EnvFile}...)
}

View file

@ -33,11 +33,13 @@ type VolumeConfiguration struct {
}
type ContainerDefinition struct {
Name string `yaml:"name"`
Image string `yaml:"image"`
Volumes []VolumeConfiguration `yaml:"volumes"`
EnvFile string `yaml:"env-file"`
ExtraArgs []string `yaml:"extra-args"`
Name string `yaml:"name"`
Image string `yaml:"image"`
Volumes []VolumeConfiguration `yaml:"volumes"`
EnvFile string `yaml:"env-file"`
Network string `yaml:"network"`
PIDNamespace string `yaml:"pid-namespace"`
ExtraArgs []string `yaml:"extra-args"`
}
type ServiceDefinition struct {