From c904c906f6073bd7c97f0f584f3646cb9eb509fd Mon Sep 17 00:00:00 2001 From: Andrey Kislyuk Date: Thu, 12 Dec 2019 13:59:48 -0800 Subject: [PATCH] Batch: explicitly specify json-file log driver This is necessary when the Docker daemon on the host is configured to use a different log driver by default. --- moto/batch/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moto/batch/models.py b/moto/batch/models.py index ab52db54c..2a764f332 100644 --- a/moto/batch/models.py +++ b/moto/batch/models.py @@ -384,8 +384,9 @@ class Job(threading.Thread, BaseModel): time.sleep(1) self.job_state = "STARTING" + log_config = docker.types.LogConfig(type=docker.types.LogConfig.types.JSON) container = self.docker_client.containers.run( - image, cmd, detach=True, name=name + image, cmd, detach=True, name=name, log_config=log_config ) self.job_state = "RUNNING" self.job_started_at = datetime.datetime.now()