use os.Environ() to set exec command's env

because `LoadContainerEnvironment` is already run, os.Environ() will return the
correct environment variables for the exec command (i.e. removed duplicated
envs, set HOME for user etc...)

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
This commit is contained in:
Daniel, Dao Quang Minh 2014-11-14 12:49:21 -05:00
parent 1c5d836b05
commit f61288fe37
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ func FinalizeSetns(container *libcontainer.Config, args []string) error {
}
}
if err := system.Execv(args[0], args[0:], container.Env); err != nil {
if err := system.Execv(args[0], args[0:], os.Environ()); err != nil {
return err
}