This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v3-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-4-test by this push:
     new ac7683e130b [v3-4-test] Put the PROD build virtualenv before 
/usr/python/bin on PATH (#75236) (#75237)
ac7683e130b is described below

commit ac7683e130b5ea1a99d4d865ff933161eea0b15d
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Oct 20 19:54:22 2026 +0200

    [v3-4-test] Put the PROD build virtualenv before /usr/python/bin on PATH 
(#75236) (#75237)
    
    With the hardened base images /usr/python is /usr, so the build stage's
    PATH="/usr/python/bin:$PATH" put Debian's pip ahead of the ~/.local
    virtualenv. Its Python also sees /usr/lib/python3/dist-packages, so pip
    treated packages there as already satisfied and never installed them into
    the virtualenv - the final image, which runs the virtualenv's Python, was
    then missing them. "pip check" in the PROD pip image failed with
    "snowflake-snowpark-python 1.55.2 requires wheel, which is not installed".
    
    Use the same PATH order as the main image.
    (cherry picked from commit 6639577b61edb56a91e1fb5e5817a2dbfada5af1)
    
    
    Generated-by: Claude Opus 5
    
    Co-authored-by: Jarek Potiuk <[email protected]>
---
 Dockerfile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 94bd2533a82..6f02f2cde6d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2270,7 +2270,11 @@ ARG USE_CONSTRAINTS_FOR_CONTEXT_DISTRIBUTIONS="false"
 
 # By default PIP installs everything to ~/.local and it's also treated as 
VIRTUALENV
 ENV VIRTUAL_ENV="${AIRFLOW_USER_HOME_DIR}/.local"
-ENV PATH="/usr/python/bin:$PATH"
+# The virtualenv must come before /usr/python/bin - same as in the main image. 
In hardened images
+# /usr/python is /usr, so /usr/python/bin holds Debian's pip, whose Python 
also sees
+# /usr/lib/python3/dist-packages. Installing with it treats packages there 
(for example wheel) as
+# already satisfied, so they never land in the virtualenv and are missing from 
the final image.
+ENV PATH="${AIRFLOW_USER_HOME_DIR}/.local/bin:/usr/python/bin:$PATH"
 RUN bash /scripts/docker/install_packaging_tools.sh; bash 
/scripts/docker/create_prod_venv.sh
 
 COPY --chown=airflow:0 ${AIRFLOW_SOURCES_FROM} ${AIRFLOW_SOURCES_TO}

Reply via email to