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 --- pkg/specgenutil/specgen.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pkg/specgenutil/specgen.go') diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go index 04d3add32..aa59b0a8d 100644 --- a/pkg/specgenutil/specgen.go +++ b/pkg/specgenutil/specgen.go @@ -711,6 +711,8 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions s.Umask = c.Umask s.PidFile = c.PidFile s.Volatile = c.Rm + s.UnsetEnv = c.UnsetEnv + s.UnsetEnvAll = c.UnsetEnvAll // Initcontainers s.InitContainerType = c.InitContainerType -- cgit v1.2.3-54-g00ecf