mirror of
/repos/baseimage-docker.git
synced 2026-02-27 17:41:59 +01:00
Fix a regression in my_init which causes it to delete environment variables passed from Docker.
This commit is contained in:
@@ -54,14 +54,15 @@ def is_exe(path):
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
def import_envvars():
|
||||
def import_envvars(clear_existing_environment = True):
|
||||
new_env = {}
|
||||
for envfile in listdir("/etc/container_environment"):
|
||||
name = os.path.basename(envfile)
|
||||
with open("/etc/container_environment/" + envfile, "r") as f:
|
||||
value = f.read()
|
||||
new_env[name] = value
|
||||
os.environ.clear()
|
||||
if clear_existing_environment:
|
||||
os.environ.clear()
|
||||
for name, value in new_env.items():
|
||||
os.environ[name] = value
|
||||
|
||||
@@ -213,7 +214,7 @@ def install_insecure_key():
|
||||
run_command_killable("/usr/sbin/enable_insecure_key")
|
||||
|
||||
def main(args):
|
||||
import_envvars()
|
||||
import_envvars(False)
|
||||
export_envvars()
|
||||
|
||||
if args.enable_insecure_key:
|
||||
|
||||
Reference in New Issue
Block a user