Remove all cached/compiled Python files after Docker build.

This commit is contained in:
Fabio Manganiello 2024-05-25 13:36:52 +02:00
parent 2e0246413c
commit e071e99dab
Signed by: blacklight
GPG key ID: D90FBA7F76362774
4 changed files with 8 additions and 0 deletions

View file

@ -20,6 +20,8 @@ RUN /install/platypush/install/scripts/alpine/install.sh && \
cd /install && \
pip install -U --no-input --no-cache-dir . --break-system-packages && \
rm -rf /install && \
rm -rf /root/.cache/pip && \
find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \
apk cache clean
EXPOSE 8008

View file

@ -23,6 +23,8 @@ RUN /install/platypush/install/scripts/debian/install.sh && \
cd /install && \
pip install -U --no-input --no-cache-dir . --break-system-packages && \
rm -rf /install && \
rm -rf /root/.cache/pip && \
find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \
apt autoclean -y && \
apt autoremove -y && \
apt clean

View file

@ -22,6 +22,8 @@ RUN dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-re
cd /install && \
pip install -U --no-input --no-cache-dir . --break-system-packages && \
rm -rf /install && \
rm -rf /root/.cache/pip && \
find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \
dnf clean all -y
EXPOSE 8008

View file

@ -23,6 +23,8 @@ RUN /install/platypush/install/scripts/debian/install.sh && \
cd /install && \
pip install -U --no-input --no-cache-dir . --break-system-packages && \
rm -rf /install && \
rm -rf /root/.cache/pip && \
find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \
apt autoclean -y && \
apt autoremove -y && \
apt clean