From 08f068d255c0dc15be5f06f540d63caf0843946e Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Sat, 6 Jul 2024 21:15:02 -0400 Subject: [PATCH] feat: support env-file input --- podman/main.go | 5 +++++ service_definition/main.go | 1 + 2 files changed, 6 insertions(+) diff --git a/podman/main.go b/podman/main.go index 7a70ca3..d47497a 100644 --- a/podman/main.go +++ b/podman/main.go @@ -91,6 +91,10 @@ func CreateContainer(definition service_definition.ContainerDefinition, knownVol "--replace", } + if definition.EnvFile != "" { + args = append(args, []string{"--env-file", definition.EnvFile}...) + } + for _, volume := range definition.Volumes { var host string var suffix string @@ -129,6 +133,7 @@ func CreateContainer(definition service_definition.ContainerDefinition, knownVol } if err := command.Wait(); err != nil { + log.Fatal(args) return err } diff --git a/service_definition/main.go b/service_definition/main.go index 713a474..53f5805 100644 --- a/service_definition/main.go +++ b/service_definition/main.go @@ -27,6 +27,7 @@ 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"` }