File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,23 @@ apt-get autoclean --yes
1717apt-get autoremove --yes
1818
1919rm -rf /var/lib/apt/lists/*
20- rm -rf /etc/apt/sources.list.d/*
2120rm -rf /usr/local/src/*
2221
2322rm -rf /var/cache/apt/*
2423rm -rf /root/.cache/*
2524# including /root/.cache/pip
25+ rm -rf /home/* /.cache/*
2626rm -rf /usr/local/share/.cache/*
2727# including /usr/local/share/.cache/yarn
2828
2929rm -rf /tmp/* /var/tmp/*
3030rm -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+
3239exit 0
Original file line number Diff line number Diff line change @@ -72,6 +72,9 @@ RUN [ -f /opt/post-install-${IMAGE2BUILD}.sh ] && /opt/post-install-${IMAGE2BUIL
7272
7373RUN 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
7679RUN useradd -m user
7780USER user
Original file line number Diff line number Diff line change @@ -85,6 +85,9 @@ RUN pip install opentelemetry-distro opentelemetry-exporter-otlp opentelemetry-i
8585
8686RUN 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
8992RUN useradd -m user
9093
Original file line number Diff line number Diff line change @@ -99,6 +99,9 @@ COPY --chown=rspy:rspy ./resources/jupyter_server_config.py /tmp/jupyter_server_
9999COPY resources/start-notebook.sh /usr/local/bin/
100100RUN 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+
102105ENTRYPOINT ["start-notebook.sh" ]
103106
104107EXPOSE 8888
You can’t perform that action at this time.
0 commit comments