mirror of
https://github.com/containers/podman.git
synced 2025-06-01 17:17:47 +08:00

The --env is used to add new environment variable to container or override the existing one. The --unsetenv is used to remove the environment variable. It is done by sharing "env" and "unsetenv" flags between both "update" and "create" commands and later handling these flags in the "update" command handler. The list of environment variables to add/remove is stored in newly added variables in the ContainerUpdateOptions. The Container.Update API call is refactored to take the ContainerUpdateOptions as an input to limit the number of its arguments. The Env and UnsetEnv lists are later handled using the envLib package and the Container is updated. The remote API is also extended to handle Env and EnvUnset. Fixes: #24875 Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
484 B
484 B
####> This option file is used in: ####> podman update ####> If file is edited, make sure the changes ####> are applicable to all of those.
--env, -e=env
Add a value (e.g. env=value) to the container. Can be used multiple times.
If the value already exists in the container, it is overridden.
To remove an environment variable from the container, use the --unsetenv
option.
Note that the env updates only affect the main container process after the next start.