File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 1- ARG FROM_PYTHON_VERSION=3.7
1+ ARG FROM_PYTHON_VERSION=3.8
22FROM deepnote/python:${FROM_PYTHON_VERSION}
33
44RUN pip install --upgrade pip
@@ -11,11 +11,17 @@ ADD requirements-below-3.11.txt /requirements-below-3.11.txt
1111#Determine the Python version and set the version-specifications file
1212ARG FROM_PYTHON_VERSION
1313RUN if [ "$(printf '%s\n' "$FROM_PYTHON_VERSION" "3.11" | sort -V | head -n1)" = "3.11" ]; then \
14- pip install -r requirements-3.11+.txt \
14+ mv " requirements-3.11+.txt" "requirements.txt" \
1515 ; else \
16- pip install -r requirements-below-3.11.txt \
16+ mv " requirements-below-3.11.txt" "requirements.txt" \
1717 ; fi
1818
19-
20- # Clean up the requirements files from the image
21- RUN rm /requirements-3.11+.txt /requirements-below-3.11.txt
19+ # Install dependencies
20+ # Combine all RUN commands into one to minimize the number of layers
21+ RUN apt-get update \
22+ && apt-get install -y --no-install-recommends gcc \
23+ && pip install --no-cache-dir -r requirements.txt \
24+ && apt-get purge -y gcc \
25+ && apt-get autoremove -y \
26+ && apt-get clean \
27+ && rm -rf /var/lib/apt/lists/* /root/.cache
You can’t perform that action at this time.
0 commit comments