mirror of
/repos/baseimage-docker.git
synced 2025-12-30 08:01:31 +01:00
Fix a regression in my_init which causes it to delete environment variables passed from Docker.
This commit is contained in:
parent
27782aca39
commit
367cddb201
@ -1,3 +1,7 @@
|
|||||||
|
## 0.9.8
|
||||||
|
|
||||||
|
* Fixed a regression in `my_init` which causes it to delete environment variables passed from Docker.
|
||||||
|
|
||||||
## 0.9.7 (release date: 2014-02-25)
|
## 0.9.7 (release date: 2014-02-25)
|
||||||
|
|
||||||
* Improved and fixed bugs in `my_init` (Thomas LÉVEIL):
|
* Improved and fixed bugs in `my_init` (Thomas LÉVEIL):
|
||||||
|
|||||||
@ -54,14 +54,15 @@ def is_exe(path):
|
|||||||
except OSError:
|
except OSError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def import_envvars():
|
def import_envvars(clear_existing_environment = True):
|
||||||
new_env = {}
|
new_env = {}
|
||||||
for envfile in listdir("/etc/container_environment"):
|
for envfile in listdir("/etc/container_environment"):
|
||||||
name = os.path.basename(envfile)
|
name = os.path.basename(envfile)
|
||||||
with open("/etc/container_environment/" + envfile, "r") as f:
|
with open("/etc/container_environment/" + envfile, "r") as f:
|
||||||
value = f.read()
|
value = f.read()
|
||||||
new_env[name] = value
|
new_env[name] = value
|
||||||
os.environ.clear()
|
if clear_existing_environment:
|
||||||
|
os.environ.clear()
|
||||||
for name, value in new_env.items():
|
for name, value in new_env.items():
|
||||||
os.environ[name] = value
|
os.environ[name] = value
|
||||||
|
|
||||||
@ -213,7 +214,7 @@ def install_insecure_key():
|
|||||||
run_command_killable("/usr/sbin/enable_insecure_key")
|
run_command_killable("/usr/sbin/enable_insecure_key")
|
||||||
|
|
||||||
def main(args):
|
def main(args):
|
||||||
import_envvars()
|
import_envvars(False)
|
||||||
export_envvars()
|
export_envvars()
|
||||||
|
|
||||||
if args.enable_insecure_key:
|
if args.enable_insecure_key:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user