From e90d33eca610e477317016131b4afe07cf515e04 Mon Sep 17 00:00:00 2001 From: Bharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com> Date: Sun, 14 May 2023 00:39:40 +0530 Subject: fix: Dockerfile - missing `packaging` dependency cause: venv fallbacks on system packages that only exist during build time issue from: 4bf16e95 --- docker-files/alpine.Dockerfile | 7 ++++--- docker-files/ubuntu.Dockerfile | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docker-files/alpine.Dockerfile b/docker-files/alpine.Dockerfile index 768cf187..7a45633d 100644 --- a/docker-files/alpine.Dockerfile +++ b/docker-files/alpine.Dockerfile @@ -50,7 +50,7 @@ RUN apk add --no-cache \ libffi-dev \ openssl-dev -RUN python${PYTHON_VERSION} -m venv --system-site-packages --without-pip venv +RUN python${PYTHON_VERSION} -m venv --without-pip venv COPY requirements.txt docker-requirements.txt webui-requirements.txt optional-requirements.txt ./ @@ -58,7 +58,7 @@ COPY requirements.txt docker-requirements.txt webui-requirements.txt optional-re # BUILD: Install the minimal image deps FROM build as buildMinimal -RUN /venv/bin/python3 -m pip install --no-cache-dir \ +RUN python${PYTHON_VERSION} -m pip install --target=/venv/lib/python${PYTHON_VERSION}/site-packages \ # Note: requirements.txt is include by dep -r docker-requirements.txt \ -r webui-requirements.txt @@ -72,7 +72,8 @@ ARG CASS_DRIVER_NO_CYTHON=1 # See issue 2368 ARG CARGO_NET_GIT_FETCH_WITH_CLI=true -RUN /venv/bin/python3 -m pip install --no-cache-dir \ +RUN python${PYTHON_VERSION} -m pip install --target=/venv/lib/python${PYTHON_VERSION}/site-packages \ + # Note: requirements.txt is include by dep -r optional-requirements.txt ############################################################################## diff --git a/docker-files/ubuntu.Dockerfile b/docker-files/ubuntu.Dockerfile index 05186eaf..c776a840 100644 --- a/docker-files/ubuntu.Dockerfile +++ b/docker-files/ubuntu.Dockerfile @@ -57,7 +57,7 @@ COPY requirements.txt docker-requirements.txt webui-requirements.txt optional-re # BUILD: Install the minimal image deps FROM build as buildMinimal -RUN /venv/bin/python3 -m pip install --no-cache-dir \ +RUN python${PYTHON_VERSION} -m pip install --target=/venv/lib/python${PYTHON_VERSION}/site-packages \ # Note: requirements.txt is include by dep -r docker-requirements.txt \ -r webui-requirements.txt @@ -66,7 +66,8 @@ RUN /venv/bin/python3 -m pip install --no-cache-dir \ # BUILD: Install all the deps FROM build as buildFull -RUN /venv/bin/python3 -m pip install --no-cache-dir \ +RUN python${PYTHON_VERSION} -m pip install --target=/venv/lib/python${PYTHON_VERSION}/site-packages \ + # Note: requirements.txt is include by dep -r optional-requirements.txt ############################################################################## -- cgit v1.2.3