Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions services/arms/judge/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
# Judge Arm Dockerfile - Multi-stage build for Python service
FROM python:3.13.7-slim as builder
FROM python:3.14.2-slim as builder

# Install system dependencies
RUN apt-get update && apt-get install -y \
Expand All @@ -23,7 +23,7 @@ RUN poetry config virtualenvs.create false && \
poetry install --only main --no-interaction --no-ansi

# Runtime stage
FROM python:3.13.7-slim
FROM python:3.14.2-slim

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

While upgrading the Python version is a good security practice, this change will break the Docker build. The COPY instruction on line 41 has a hardcoded Python version (3.13) in the path.

# line 41
COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages

With this upgrade to Python 3.14, the path needs to be updated to .../python3.14/... for the COPY command to find the source files. Without this change, the build will fail.

Recommendation:

Update line 41 to:

COPY --from=builder /usr/local/lib/python3.14/site-packages /usr/local/lib/python3.14/site-packages

Long-term improvement:

To make future Python upgrades easier, consider using a build argument for the Python version throughout the Dockerfile. This avoids hardcoding the version in multiple places.

Example:

ARG PYTHON_MAJOR_MINOR_VERSION=3.14
ARG PYTHON_FULL_VERSION=3.14.2
FROM python:${PYTHON_FULL_VERSION}-slim as builder

# ...

# Runtime stage
FROM python:${PYTHON_FULL_VERSION}-slim

# ...

# Copy installed packages from builder
COPY --from=builder /usr/local/lib/python${PYTHON_MAJOR_MINOR_VERSION}/site-packages /usr/local/lib/python${PYTHON_MAJOR_MINOR_VERSION}/site-packages

This way, you'd only need to update the ARG values for future upgrades.


# Install runtime dependencies
RUN apt-get update && apt-get install -y \
Expand Down
Loading