From 3d7f584f6453c27f9435d3a7b10b120b93650093 Mon Sep 17 00:00:00 2001 From: Loukas Leontopoulos Date: Mon, 19 Feb 2018 17:28:35 +0200 Subject: [PATCH] Change lambda backend to support docker changes --- moto/awslambda/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moto/awslambda/models.py b/moto/awslambda/models.py index 947691bc..3c3d3ea6 100644 --- a/moto/awslambda/models.py +++ b/moto/awslambda/models.py @@ -104,7 +104,7 @@ class _DockerDataVolumeContext: # It doesn't exist so we need to create it self._vol_ref.volume = self._lambda_func.docker_client.volumes.create(self._lambda_func.code_sha_256) - container = self._lambda_func.docker_client.containers.run('alpine', 'sleep 100', volumes={self.name: '/tmp/data'}, detach=True) + container = self._lambda_func.docker_client.containers.run('alpine', 'sleep 100', volumes={self.name: {'bind': '/tmp/data', 'mode': 'rw'}}, detach=True) try: tar_bytes = zip2tar(self._lambda_func.code_bytes) container.put_archive('/tmp/data', tar_bytes) @@ -309,7 +309,7 @@ class LambdaFunction(BaseModel): finally: if container: try: - exit_code = container.wait(timeout=300) + exit_code = container.wait(timeout=300)['StatusCode'] except requests.exceptions.ReadTimeout: exit_code = -1 container.stop()