diff --git a/python/datascience/Dockerfile.datascience b/python/datascience/Dockerfile.datascience index 045caec..8deb165 100644 --- a/python/datascience/Dockerfile.datascience +++ b/python/datascience/Dockerfile.datascience @@ -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 \ No newline at end of file