add support for stop_signal to compose file

Signed-off-by: Jonathan Stewmon <jstewmon@rmn.com>
This commit is contained in:
Jonathan Stewmon 2015-12-04 16:40:09 -06:00
commit 5d8c2d3cec
7 changed files with 39 additions and 0 deletions

View file

@ -62,6 +62,7 @@ DOCKER_CONFIG_KEYS = [
'restart',
'security_opt',
'stdin_open',
'stop_signal',
'tty',
'user',
'volume_driver',

View file

@ -94,6 +94,7 @@
"restart": {"type": "string"},
"security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
"stdin_open": {"type": "boolean"},
"stop_signal": {"type": "string"},
"tty": {"type": "boolean"},
"ulimits": {
"type": "object",

View file

@ -101,6 +101,7 @@
"restart": {"type": "string"},
"security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
"stdin_open": {"type": "boolean"},
"stop_signal": {"type": "string"},
"tty": {"type": "boolean"},
"ulimits": {
"type": "object",

View file

@ -107,6 +107,10 @@ class Container(object):
def labels(self):
return self.get('Config.Labels') or {}
@property
def stop_signal(self):
return self.get('Config.StopSignal')
@property
def log_config(self):
return self.get('HostConfig.LogConfig') or None
@ -132,6 +136,10 @@ class Container(object):
def environment(self):
return dict(var.split("=", 1) for var in self.get('Config.Env') or [])
@property
def exit_code(self):
return self.get('State.ExitCode')
@property
def is_running(self):
return self.get('State.Running')