Clean up all package manager caches after Docker build.

This commit is contained in:
Fabio Manganiello 2024-05-25 14:15:13 +02:00
parent e071e99dab
commit 3a4d7afcf0
Signed by: blacklight
GPG key ID: D90FBA7F76362774
4 changed files with 10 additions and 2 deletions

View file

@ -22,7 +22,9 @@ RUN /install/platypush/install/scripts/alpine/install.sh && \
rm -rf /install && \ rm -rf /install && \
rm -rf /root/.cache/pip && \ rm -rf /root/.cache/pip && \
find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \ find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \
apk cache clean apk del gcc git && \
apk cache clean && \
rm -rf /var/cache/apk/*
EXPOSE 8008 EXPOSE 8008

View file

@ -25,6 +25,8 @@ RUN /install/platypush/install/scripts/debian/install.sh && \
rm -rf /install && \ rm -rf /install && \
rm -rf /root/.cache/pip && \ rm -rf /root/.cache/pip && \
find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \ find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \
apt remove -y git build-essential && \
rm -rf /var/lib/apt/lists/* && \
apt autoclean -y && \ apt autoclean -y && \
apt autoremove -y && \ apt autoremove -y && \
apt clean apt clean

View file

@ -24,7 +24,9 @@ RUN dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-re
rm -rf /install && \ rm -rf /install && \
rm -rf /root/.cache/pip && \ rm -rf /root/.cache/pip && \
find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \ find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \
dnf clean all -y dnf remove -y build-essential git && \
dnf clean all -y && \
rm -rf /var/cache/dnf/*
EXPOSE 8008 EXPOSE 8008

View file

@ -25,6 +25,8 @@ RUN /install/platypush/install/scripts/debian/install.sh && \
rm -rf /install && \ rm -rf /install && \
rm -rf /root/.cache/pip && \ rm -rf /root/.cache/pip && \
find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \ find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \
apt remove -y git build-essential && \
rm -rf /var/lib/apt/lists/* && \
apt autoclean -y && \ apt autoclean -y && \
apt autoremove -y && \ apt autoremove -y && \
apt clean apt clean