From e071e99dabf18fb70c74ac9fb0f785105bd004ff Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 25 May 2024 13:36:52 +0200 Subject: [PATCH] Remove all cached/compiled Python files after Docker build. --- platypush/install/docker/alpine.Dockerfile | 2 ++ platypush/install/docker/debian.Dockerfile | 2 ++ platypush/install/docker/fedora.Dockerfile | 2 ++ platypush/install/docker/ubuntu.Dockerfile | 2 ++ 4 files changed, 8 insertions(+) diff --git a/platypush/install/docker/alpine.Dockerfile b/platypush/install/docker/alpine.Dockerfile index 47856d004..b522f15cc 100644 --- a/platypush/install/docker/alpine.Dockerfile +++ b/platypush/install/docker/alpine.Dockerfile @@ -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 diff --git a/platypush/install/docker/debian.Dockerfile b/platypush/install/docker/debian.Dockerfile index d19248db0..5e4234375 100644 --- a/platypush/install/docker/debian.Dockerfile +++ b/platypush/install/docker/debian.Dockerfile @@ -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 diff --git a/platypush/install/docker/fedora.Dockerfile b/platypush/install/docker/fedora.Dockerfile index 0999494c7..ebf34a8d3 100644 --- a/platypush/install/docker/fedora.Dockerfile +++ b/platypush/install/docker/fedora.Dockerfile @@ -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 diff --git a/platypush/install/docker/ubuntu.Dockerfile b/platypush/install/docker/ubuntu.Dockerfile index 65e86b4c2..2e5d682f6 100644 --- a/platypush/install/docker/ubuntu.Dockerfile +++ b/platypush/install/docker/ubuntu.Dockerfile @@ -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