aboutsummaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/container.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/specgen/generate/container.go')
-rw-r--r--pkg/specgen/generate/container.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go
index 59fee80f1..06ffa3df6 100644
--- a/pkg/specgen/generate/container.go
+++ b/pkg/specgen/generate/container.go
@@ -86,6 +86,15 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
s.Env = envLib.Join(envLib.Join(defaultEnvs, envs), s.Env)
+ // Ensure that default environment variables are populated.
+ // Container must have PATH and TERM set, even if nothing else set them.
+ baseEnv := envLib.DefaultEnvVariables()
+ for k, v := range baseEnv {
+ if _, ok := s.Env[k]; !ok {
+ s.Env[k] = v
+ }
+ }
+
// Labels and Annotations
annotations := make(map[string]string)
if newImage != nil {