Skip to content
Merged
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
16 changes: 11 additions & 5 deletions python/datascience/Dockerfile.datascience
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ ARG FROM_PYTHON_VERSION
RUN python -m pip install --upgrade setuptools pip

RUN if [ "$(printf '%s\n' "$FROM_PYTHON_VERSION" "3.11" | sort -V | head -n1)" = "3.11" ]; then \
pip install -r requirements-3.11+.txt -c constraints.txt\
mv "requirements-3.11+.txt" "requirements.txt" \
; else \
pip install -r requirements-below-3.11.txt -c constraints.txt\
mv "requirements-below-3.11.txt" "requirements.txt" \
; fi


# Clean up the requirements files from the image
RUN rm /requirements-3.11+.txt /requirements-below-3.11.txt
# Install dependencies
# Combine all RUN commands into one to minimize the number of layers
RUN apt-get update \
&& apt-get install -y --no-install-recommends gcc \
&& pip install --no-cache-dir -r requirements.txt -c constraints.txt \
&& apt-get purge -y gcc \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /root/.cache