From 44d1618dd7eeb2560571b14ba5cece69a93dcaff Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 26 Oct 2021 12:16:21 -0400 Subject: Add --unsetenv & --unsetenv-all to remove def environment variables Podman adds a few environment variables by default, and currently there is no way to get rid of them from your container. This option will allow you to specify which defaults you don't want. --unsetenv-all will remove all default environment variables. Default environment variables can come from podman builtin, containers.conf or from the container image. Fixes: https://github.com/containers/podman/issues/11836 Signed-off-by: Daniel J Walsh --- libpod/container_inspect.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libpod/container_inspect.go') diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go index 277c3b960..0dae810de 100644 --- a/libpod/container_inspect.go +++ b/libpod/container_inspect.go @@ -300,8 +300,7 @@ func (c *Container) generateInspectContainerConfig(spec *spec.Spec) *define.Insp ctrConfig.User = c.config.User if spec.Process != nil { ctrConfig.Tty = spec.Process.Terminal - ctrConfig.Env = []string{} - ctrConfig.Env = append(ctrConfig.Env, spec.Process.Env...) + ctrConfig.Env = append([]string{}, spec.Process.Env...) ctrConfig.WorkingDir = spec.Process.Cwd } -- cgit v1.2.3-54-g00ecf