From cc4a1ea8d3fc6cc9c4697acd52c7f1d9e0b51d2a Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 28 Apr 2020 16:10:29 -0400 Subject: User specified environment after other environments are set Users can not currently override the environment variables set by --http-proxy Signed-off-by: Daniel J Walsh --- pkg/spec/spec.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go index 5de07fc28..c9a068578 100644 --- a/pkg/spec/spec.go +++ b/pkg/spec/spec.go @@ -326,10 +326,6 @@ func (config *CreateConfig) createConfigToOCISpec(runtime *libpod.Runtime, userM } defaultEnv = env.Join(env.DefaultEnvVariables, defaultEnv) } - config.Env = env.Join(defaultEnv, config.Env) - for name, val := range config.Env { - g.AddProcessEnv(name, val) - } if err := addRlimits(config, &g); err != nil { return nil, err @@ -360,6 +356,11 @@ func (config *CreateConfig) createConfigToOCISpec(runtime *libpod.Runtime, userM if err := config.Cgroup.ConfigureGenerator(&g); err != nil { return nil, err } + + config.Env = env.Join(defaultEnv, config.Env) + for name, val := range config.Env { + g.AddProcessEnv(name, val) + } configSpec := g.Config // If the container image specifies an label with a -- cgit v1.2.3-54-g00ecf