From 2308c4e9270e48ed0a83f19ab28a3127d3832448 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 30 Sep 2024 22:22:47 +0200 Subject: [PATCH] Deeper cleanup of cache and tmp files in Dockerfile. --- platypush/install/docker/alpine.Dockerfile | 6 ++++-- platypush/install/docker/debian.Dockerfile | 7 +++++-- platypush/install/docker/fedora.Dockerfile | 7 ++++--- platypush/install/docker/ubuntu.Dockerfile | 7 +++++-- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/platypush/install/docker/alpine.Dockerfile b/platypush/install/docker/alpine.Dockerfile index 92abf62716..b15ef7e3b2 100644 --- a/platypush/install/docker/alpine.Dockerfile +++ b/platypush/install/docker/alpine.Dockerfile @@ -20,11 +20,13 @@ 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 && \ + rm -rf /root/.cache && \ find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \ apk del gcc git && \ apk cache clean && \ - rm -rf /var/cache/apk/* + rm -rf /var/cache/apk/* && \ + rm -rf /tmp/* && \ + find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf EXPOSE 8008 diff --git a/platypush/install/docker/debian.Dockerfile b/platypush/install/docker/debian.Dockerfile index b4da96a7a6..346ee8c676 100644 --- a/platypush/install/docker/debian.Dockerfile +++ b/platypush/install/docker/debian.Dockerfile @@ -23,13 +23,16 @@ 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 && \ + rm -rf /root/.cache && \ 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 autoremove -y && \ - apt clean + apt clean && \ + rm -rf /var/cache/apt/* && \ + rm -rf /tmp/* && \ + find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf EXPOSE 8008 diff --git a/platypush/install/docker/fedora.Dockerfile b/platypush/install/docker/fedora.Dockerfile index 3ce87df617..e028e03df7 100644 --- a/platypush/install/docker/fedora.Dockerfile +++ b/platypush/install/docker/fedora.Dockerfile @@ -22,11 +22,12 @@ 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 && \ + rm -rf /root/.cache && \ dnf remove -y build-essential git && \ dnf clean all -y && \ - rm -rf /var/cache/dnf/* + rm -rf /var/cache/dnf/* && \ + rm -rf /tmp/* && \ + find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf EXPOSE 8008 diff --git a/platypush/install/docker/ubuntu.Dockerfile b/platypush/install/docker/ubuntu.Dockerfile index 10b3c1b15c..d03210487f 100644 --- a/platypush/install/docker/ubuntu.Dockerfile +++ b/platypush/install/docker/ubuntu.Dockerfile @@ -23,13 +23,16 @@ 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 && \ + rm -rf /root/.cache && \ 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 autoremove -y && \ - apt clean + apt clean && \ + rm -rf /var/cache/apt/* && \ + rm -rf /tmp/* && \ + find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf EXPOSE 8008