From 7e6ee423c4aae1c2ff4a51224de19769387aadc5 Mon Sep 17 00:00:00 2001 From: maxday Date: Thu, 26 Aug 2021 18:13:29 -0400 Subject: [PATCH] make docker build faster --- tests/Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/Dockerfile b/tests/Dockerfile index 218fe3b2..86bafa0b 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -3,9 +3,15 @@ FROM python:$python_version ENV PYTHONDONTWRITEBYTECODE True -RUN mkdir -p /test +RUN mkdir -p /test/datadog_lambda WORKDIR /test +# Copy minimal subset of files to make pip install succeed and be cached (next docker builds will be way faster) +COPY setup.py . +COPY README.md . +COPY datadog_lambda/__init__.py datadog_lambda/__init__.py + +RUN pip install .[dev] + # Install datadog-lambda with dev dependencies from local COPY . . -RUN pip install .[dev] \ No newline at end of file