From 881fd1bd3340e1d87fdfa0fff31a834c7d35aeed Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Thu, 12 Oct 2023 16:33:24 -0400 Subject: [PATCH] docker: split compile image and build image to remove cache (#374) Signed-off-by: Jinzhe Zeng --- Dockerfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b0fb567c..0159c2c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,14 @@ -FROM python:3.11 +FROM python:3.12 AS compile-image + +RUN python -m venv /opt/venv +# Make sure we use the virtualenv +ENV PATH="/opt/venv/bin:$PATH" WORKDIR /data/dpdispatcher COPY ./ ./ RUN pip install .[bohrium] + +FROM python:3.12 AS build-image +COPY --from=compile-image /opt/venv /opt/venv +ENV PATH="/opt/venv/bin:$PATH" +CMD ["/bin/bash"]