Skip to content

Commit 4ae73db

Browse files
Code Upload Worker: Fix code upload worker image build on Python 3.9(#5105)
Pin requests to 2.32.5 because 2.33.0 requires Python 3.10+, and split the Dockerfile pip/cleanup steps so pip install failures are not masked by || true or a failing cache-mount rm.
1 parent 3aab0ea commit 4ae73db

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

docker/prod/code-upload-worker/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ COPY requirements/ /code/requirements/
2020

2121
# Install Python dependencies with BuildKit cache mount
2222
RUN --mount=type=cache,target=/root/.cache/pip \
23-
pip install --no-cache-dir --no-compile -r requirements/code_upload_worker.txt && \
24-
# Clean up pip cache and Python bytecode (directories first, then files)
25-
rm -rf /root/.cache/pip && \
26-
find /usr/local/lib/python3.9/site-packages -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true && \
23+
pip install --no-cache-dir --no-compile -r requirements/code_upload_worker.txt
24+
25+
# Best-effort bytecode cleanup; keep separate so pip failures fail the build.
26+
RUN find /usr/local/lib/python3.9/site-packages -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true && \
2727
find /usr/local/lib/python3.9/site-packages \( -name "*.pyc" -o -name "*.pyo" \) -delete 2>/dev/null || true
2828

2929
# Stage 2: Minimal runtime stage (needs shell for install script, so can't use distroless)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
kubernetes==12.0.1
22
PyYaml==5.4.1
3-
requests==2.33.0
3+
requests==2.32.5

0 commit comments

Comments
 (0)