File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,9 @@ ADD patches/kaggle_datasets.py /root/.local/lib/${PYTHON_VERSION_PATH}/site-pack
2828# Prereqs
2929# This is needed for cv2 (opencv-python):
3030# https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo
31- RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
31+ RUN /tmp/clean-layer.sh && \
32+ apt-get update && apt-get install ffmpeg libsm6 libxext6 -y && \
33+ /tmp/clean-layer.sh
3234
3335# Install all the packages together for maximum compatibility.
3436# Additional useful packages should be added in the requirements.txt
Original file line number Diff line number Diff line change @@ -19,4 +19,12 @@ apt-get clean
1919# Ensures the current working directory won't be deleted
2020cd /usr/local/src/
2121# Delete source files used for building binaries
22- rm -rf /usr/local/src/*
22+ rm -rf /usr/local/src/*
23+
24+ # More clean up to save disk space
25+ rm -rf /var/lib/apt/lists/*
26+ find /tmp -mindepth 1 ! -name ' clean-layer.sh' -delete 2> /dev/null || true
27+ rm -rf /root/.cache
28+ rm -rf /var/cache/apt/archives/*
29+ find /usr -name ' *.pyc' -delete 2> /dev/null || true
30+ find /usr -name ' __pycache__' -type d -exec rm -rf {} + 2> /dev/null || true
You can’t perform that action at this time.
0 commit comments