Skip to content

Commit 3081b5b

Browse files
authored
1 parent f0aa188 commit 3081b5b

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

Dockerfile.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ RUN uv pip install --system --no-cache "pycuda"
4444

4545
# Use a fixed apt-get repo to stop intermittent failures due to flaky httpredir connections,
4646
# as described by Lionel Chan at http://stackoverflow.com/a/37426929/5881346
47+
RUN /tmp/clean-layer.sh
4748
RUN sed -i "s/httpredir.debian.org/debian.uchicago.edu/" /etc/apt/sources.list && \
4849
apt-get update --allow-releaseinfo-change && \
4950
# Needed by lightGBM (GPU build)

clean-layer.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,12 @@ apt-get clean
1717
# Ensures the current working directory won't be deleted
1818
cd /usr/local/src/
1919
# Delete source files used for building binaries
20-
rm -rf /usr/local/src/*
20+
rm -rf /usr/local/src/*
21+
22+
# More clean up to save disk space
23+
rm -rf /var/lib/apt/lists/*
24+
find /tmp -mindepth 1 ! -name 'clean-layer.sh' -delete 2>/dev/null || true
25+
rm -rf /root/.cache
26+
rm -rf /var/cache/apt/archives/*
27+
find /usr -name '*.pyc' -delete 2>/dev/null || true
28+
find /usr -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true

0 commit comments

Comments
 (0)