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
3
pyentrypoint/command.py
Normal file → Executable file
3
pyentrypoint/command.py
Normal file → Executable file
@ -99,7 +99,8 @@ class Command(object):
|
||||
def run(self):
|
||||
if not self.is_handled:
|
||||
self._exec()
|
||||
self._rm_dockerenv()
|
||||
if self.config.remove_dockerenv:
|
||||
self._rm_dockerenv()
|
||||
if os.getuid() is 0:
|
||||
os.setgid(self.config.group)
|
||||
os.setuid(self.config.user)
|
||||
|
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