From f7e32d1451b4b962a22fb769523a056d051f0326 Mon Sep 17 00:00:00 2001 From: Jennifer Power Date: Fri, 12 Jan 2024 13:48:39 -0500 Subject: [PATCH] chore(deps): updates Dockerfile to upgrade setuptools during build (#144) * chore(deps): updates Dockerfile to upgrade setuptools during build Signed-off-by: Jennifer Power * chore: removes path updates for POETRY_HOME Signed-off-by: Jennifer Power --------- Signed-off-by: Jennifer Power --- Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9ae61aea..86788347 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,22 +26,21 @@ FROM python-base AS dependencies ARG POETRY_VERSION=1.7.1 # https://python-poetry.org/docs/configuration/#using-environment-variables -ENV POETRY_HOME="/opt/poetry" \ - POETRY_VIRTUALENVS_IN_PROJECT=true \ +ENV POETRY_VIRTUALENVS_IN_PROJECT=true \ POETRY_NO_INTERACTION=1 -ENV PATH="$POETRY_HOME/bin:$PATH" - -# install poetry - respects $POETRY_HOME -RUN python3.9 -m pip install --no-cache-dir --upgrade pip \ - && pip install --no-cache-dir poetry=="$POETRY_VERSION" +# install poetry globally just for this intermediate build stage +RUN python3.9 -m pip install --no-cache-dir --upgrade pip setuptools && \ + python3.9 -m pip install --no-cache-dir "poetry==$POETRY_VERSION" WORKDIR "/build" COPY . "/build" # Install runtime deps and install the project in non-editable mode. +# Ensure pip and setuptools are updated in the virtualenv as well. RUN python3.9 -m venv "$VENV_PATH" && \ . "$VENV_PATH"/bin/activate && \ + python3.9 -m pip install --no-cache-dir --upgrade pip setuptools && \ poetry install --without tests,dev --no-root && \ poetry build -f wheel -n && \ pip install --no-cache-dir --no-deps dist/*.whl && \