mirror of
https://github.com/cmehay/pyentrypoint
synced 2024-10-30 15:21:11 +00:00
Merge pull request #18 from scottjs/dockerenv_config
Added config option to specify whether or not to remove the dockerenv and dockerinit files
This commit is contained in:
commit
d1dd94765d
1
pyentrypoint/command.py
Normal file → Executable file
1
pyentrypoint/command.py
Normal file → Executable file
@ -99,6 +99,7 @@ class Command(object):
|
||||
def run(self):
|
||||
if not self.is_handled:
|
||||
self._exec()
|
||||
if self.config.remove_dockerenv:
|
||||
self._rm_dockerenv()
|
||||
if os.getuid() is 0:
|
||||
os.setgid(self.config.group)
|
||||
|
7
pyentrypoint/config.py
Normal file → Executable file
7
pyentrypoint/config.py
Normal file → Executable file
@ -226,6 +226,13 @@ class Config(ConfigMeta):
|
||||
return bool(self._config['clean_env'])
|
||||
return True
|
||||
|
||||
@property
|
||||
def remove_dockerenv(self):
|
||||
"""Remove dockerenv and dockerinit files"""
|
||||
if 'remove_dockerenv' in self._config:
|
||||
return bool(self._config['remove_dockerenv'])
|
||||
return True
|
||||
|
||||
@property
|
||||
def debug(self):
|
||||
"""Enable debug logs."""
|
||||
|
Loading…
Reference in New Issue
Block a user