Skip to content

Commit eac0115

Browse files
committed
Test optimise size of datasicence image
1 parent ceb5fdd commit eac0115

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG FROM_PYTHON_VERSION=3.7
1+
ARG FROM_PYTHON_VERSION=3.8
22
FROM deepnote/python:${FROM_PYTHON_VERSION}
33

44
RUN 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
1212
ARG FROM_PYTHON_VERSION
1313
RUN 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

0 commit comments

Comments
 (0)