From 45687e1dfac96b7116660569734f876332f6b39f Mon Sep 17 00:00:00 2001 From: Baptiste Bouchereau Date: Mon, 18 May 2020 14:58:32 +0200 Subject: [PATCH] Use LAMBDA_REMOVE_CONTAINERS set to false instead of a custom image --- localstack-part-3/docker-compose.yml | 4 ++-- localstack-part-3/localstack/Dockerfile | 5 ----- localstack-part-3/localstack/localstack.patch | 13 ------------- 3 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 localstack-part-3/localstack/Dockerfile delete mode 100644 localstack-part-3/localstack/localstack.patch diff --git a/localstack-part-3/docker-compose.yml b/localstack-part-3/docker-compose.yml index fc6961f..9f54dd5 100644 --- a/localstack-part-3/docker-compose.yml +++ b/localstack-part-3/docker-compose.yml @@ -13,8 +13,7 @@ volumes: services: localstack: - build: - context: localstack + image: localstack/localstack:0.10.8 container_name: localstack ports: - 8080:8080 # webui @@ -27,6 +26,7 @@ services: - PORT_WEB_UI=8080 - SERVICES=lambda,dynamodb - LAMBDA_DOCKER_NETWORK=localstack-tutorial + - LAMBDA_REMOVE_CONTAINERS=false volumes: - /var/run/docker.sock:/var/run/docker.sock - localstack:/tmp/localstack/data diff --git a/localstack-part-3/localstack/Dockerfile b/localstack-part-3/localstack/Dockerfile deleted file mode 100644 index 502da04..0000000 --- a/localstack-part-3/localstack/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM localstack/localstack:0.10.7 - -# Update localstack code to prevent the destruction of the lambda containers every 10 minutes -COPY localstack.patch /opt/code/localstack/localstack.patch -RUN apk add git && git apply localstack.patch && apk del --purge git diff --git a/localstack-part-3/localstack/localstack.patch b/localstack-part-3/localstack/localstack.patch deleted file mode 100644 index 12170fe..0000000 --- a/localstack-part-3/localstack/localstack.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/localstack/services/awslambda/lambda_executors.py b/localstack/services/awslambda/lambda_executors.py -index 19f1e07..85d4781 100644 ---- a/localstack/services/awslambda/lambda_executors.py -+++ b/localstack/services/awslambda/lambda_executors.py -@@ -301,7 +301,7 @@ class LambdaExecutorReuseContainers(LambdaExecutorContainers): - def startup(self): - self.cleanup() - # start a process to remove idle containers -- self.start_idle_container_destroyer_interval() -+ # self.start_idle_container_destroyer_interval() - - def cleanup(self, arn=None): - if arn: