catch run errors
This commit is contained in:
parent
c4e984a709
commit
f546ca8817
4
runon
4
runon
@ -125,8 +125,12 @@ def create_container(client, image, conf, command, verbose):
|
||||
|
||||
|
||||
def run_container(client, container):
|
||||
try:
|
||||
dockerpty.start(client.api, container.id)
|
||||
container.reload() # to update attrs fields
|
||||
except docker.errors.APIError as e:
|
||||
print('ERROR: {}'.format(e))
|
||||
sys.exit(1)
|
||||
ret = container.attrs['State']['ExitCode']
|
||||
return ret
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user