Skip to content

Commit 5517149

Browse files
authored
Merge pull request #204 from RS-PYTHON/layer-cleanup
Update layer-cleanup.sh
2 parents b72c94d + 2c50ff5 commit 5517149

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

.github/common/resources/layer-cleanup.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,23 @@ apt-get autoclean --yes
1717
apt-get autoremove --yes
1818

1919
rm -rf /var/lib/apt/lists/*
20-
rm -rf /etc/apt/sources.list.d/*
2120
rm -rf /usr/local/src/*
2221

2322
rm -rf /var/cache/apt/*
2423
rm -rf /root/.cache/*
2524
# including /root/.cache/pip
25+
rm -rf /home/*/.cache/*
2626
rm -rf /usr/local/share/.cache/*
2727
# including /usr/local/share/.cache/yarn
2828

2929
rm -rf /tmp/* /var/tmp/*
3030
rm -rf /opt/conda/pkgs/cache
3131

32+
rm -rf /tmp/whl
33+
34+
# WARNING: this removes the apt repository list. To restore it and be able to run 'apt update',
35+
# you must run (works only in Debian):
36+
# . /etc/os-release && echo "deb http://deb.debian.org/debian $VERSION_CODENAME main" > /etc/apt/sources.list
37+
rm -rf /etc/apt/sources.list.d/*
38+
3239
exit 0

.github/dask-gateway/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ RUN [ -f /opt/post-install-${IMAGE2BUILD}.sh ] && /opt/post-install-${IMAGE2BUIL
7272

7373
RUN apt autoremove -y gcc && layer-cleanup.sh
7474

75+
# Remove apt repository list and custom scripts
76+
RUN rm -f /etc/apt/sources.list /usr/local/bin/layer-cleanup.sh /usr/local/bin/restore-apt.sh
77+
7578
# Add a default user
7679
RUN useradd -m user
7780
USER user

.github/dask-gateway/Dockerfile.mockup

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ RUN pip install opentelemetry-distro opentelemetry-exporter-otlp opentelemetry-i
8585

8686
RUN apt update && apt install -y python3-pydot graphviz && layer-cleanup.sh
8787

88+
# Remove apt repository list and custom scripts
89+
RUN rm -f /etc/apt/sources.list /usr/local/bin/layer-cleanup.sh /usr/local/bin/restore-apt.sh
90+
8891
# Add a default user
8992
RUN useradd -m user
9093

.github/jupyter/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ COPY --chown=rspy:rspy ./resources/jupyter_server_config.py /tmp/jupyter_server_
9999
COPY resources/start-notebook.sh /usr/local/bin/
100100
RUN chmod 755 /usr/local/bin/start-notebook.sh
101101

102+
# Remove apt repository list and custom scripts
103+
RUN rm -f /etc/apt/sources.list /usr/local/bin/layer-cleanup.sh /usr/local/bin/restore-apt.sh
104+
102105
ENTRYPOINT ["start-notebook.sh"]
103106

104107
EXPOSE 8888

0 commit comments

Comments
 (0)