Skip to content

Commit 1ec9d7f

Browse files
committed
[RAPTOR-14742] python311: Use system pip
The upstream pip has a security vulnerability, CVE-2025-8869, which has been fixed, but not released, and it is uncertain when the fix will be released. Chainguard has however fixed pip in their version. To use their fixed version, this changes the virtualenv setup process to use the system pip and not install a virtualenv version of pip. This prevents the vulnerability from being reintroduced during virtualenv pip installation.
1 parent eff06a0 commit 1ec9d7f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

public_dropin_environments/python311/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ COPY --from=build /bin/mkdir /bin/mkdir
3030

3131
# Required for custom-models to install dependencies
3232
COPY --from=build /usr/bin/pip /usr/bin/pip
33+
COPY --from=build /usr/lib/python3.11/site-packages/pip /usr/lib/python3.11/site-packages/pip
3334

3435
# Cleanup '__pycache__' directories. It solves an AsymmetricPrivateKey scanning error.
3536
COPY --from=build /usr/bin/rm /usr/bin/rm
@@ -42,10 +43,8 @@ COPY requirements.txt requirements.txt
4243

4344
ENV VIRTUAL_ENV=/opt/venv
4445

45-
RUN sh -c "python -m venv ${VIRTUAL_ENV} && \
46+
RUN sh -c "python -m venv --without-pip --system-site-packages ${VIRTUAL_ENV} && \
4647
. ${VIRTUAL_ENV}/bin/activate && \
47-
python -m ensurepip --default-pip && \
48-
python -m pip install --upgrade pip && \
4948
python -m pip install --no-cache-dir -r requirements.txt && \
5049
find ${VIRTUAL_ENV} -type d -name '__pycache__' -exec rm -rf {} +"
5150

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"id": "67a554baeade3a4ce2ab6700",
2+
"id": "67a554bbfbef3a4ce2ab6700",
33
"name": "[DataRobot] Python 3.11 Drop-In",
44
"description": "This template environment can be used to create Python based custom models. User is responsible to provide requirements.txt with the model, to install all the required dependencies.",
55
"programmingLanguage": "python",
66
"label": "",
7-
"environmentVersionId": "68ddb0110008035274003e75",
7+
"environmentVersionId": "67a554bbfbef4b4ce2ab6700",
88
"environmentVersionDescription": "",
99
"isPublic": true,
1010
"isDownloadable": true,
@@ -14,8 +14,8 @@
1414
"contextUrl": "https://github.com/datarobot/datarobot-user-models/tree/master/public_dropin_environments/python311",
1515
"imageRepository": "env-python",
1616
"tags": [
17-
"v11.2.0-68ddb0110008035274003e75",
18-
"68ddb0110008035274003e75",
17+
"v11.2.0-67a554bbfbef4b4ce2ab6700",
18+
"67a554bbfbef4b4ce2ab6700",
1919
"v11.2.0-latest"
2020
]
2121
}

0 commit comments

Comments
 (0)