Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion tpu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ ADD patches/kaggle_datasets.py /root/.local/lib/${PYTHON_VERSION_PATH}/site-pack
# Prereqs
# This is needed for cv2 (opencv-python):
# https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
RUN /tmp/clean-layer.sh && \
apt-get update && apt-get install ffmpeg libsm6 libxext6 -y && \
/tmp/clean-layer.sh

# Install all the packages together for maximum compatibility.
# Additional useful packages should be added in the requirements.txt
Expand Down
10 changes: 9 additions & 1 deletion tpu/clean-layer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,12 @@ apt-get clean
# Ensures the current working directory won't be deleted
cd /usr/local/src/
# Delete source files used for building binaries
rm -rf /usr/local/src/*
rm -rf /usr/local/src/*

# More clean up to save disk space
rm -rf /var/lib/apt/lists/*
find /tmp -mindepth 1 ! -name 'clean-layer.sh' -delete 2>/dev/null || true
rm -rf /root/.cache
rm -rf /var/cache/apt/archives/*
find /usr -name '*.pyc' -delete 2>/dev/null || true
find /usr -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true
Loading