feat: support env-file input
All checks were successful
/ build (push) Successful in 59s

This commit is contained in:
Marc 2024-07-06 21:15:02 -04:00
parent 2ce774a249
commit 08f068d255
Signed by: marc
GPG key ID: 048E042F22B5DC79
2 changed files with 6 additions and 0 deletions

View file

@ -91,6 +91,10 @@ func CreateContainer(definition service_definition.ContainerDefinition, knownVol
"--replace", "--replace",
} }
if definition.EnvFile != "" {
args = append(args, []string{"--env-file", definition.EnvFile}...)
}
for _, volume := range definition.Volumes { for _, volume := range definition.Volumes {
var host string var host string
var suffix string var suffix string
@ -129,6 +133,7 @@ func CreateContainer(definition service_definition.ContainerDefinition, knownVol
} }
if err := command.Wait(); err != nil { if err := command.Wait(); err != nil {
log.Fatal(args)
return err return err
} }

View file

@ -27,6 +27,7 @@ type ContainerDefinition struct {
Name string `yaml:"name"` Name string `yaml:"name"`
Image string `yaml:"image"` Image string `yaml:"image"`
Volumes []VolumeConfiguration `yaml:"volumes"` Volumes []VolumeConfiguration `yaml:"volumes"`
EnvFile string `yaml:"env-file"`
ExtraArgs []string `yaml:"extra-args"` ExtraArgs []string `yaml:"extra-args"`
} }