Kill the container when our program exits

pull/6/head
yuvipanda 2017-05-22 23:00:37 -07:00
rodzic eac759ccd4
commit 9fca3bf480
1 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -180,8 +180,13 @@ class Repo2Docker(Application):
ports={'8888/tcp': 8888},
detach=True
)
for line in container.logs(stream=True):
self.log.info(line.decode('utf-8').rstrip(), extra=dict(phase='running'))
try:
for line in container.logs(stream=True):
self.log.info(line.decode('utf-8').rstrip(), extra=dict(phase='running'))
finally:
self.log.info('Stopping container...', extra=dict(phase='running'))
container.kill()
container.remove()
def start(self):
# HACK: Try to just pull this and see if that works.