From 1934915ae871a8d8113e125459ef3e5c2ccc459f Mon Sep 17 00:00:00 2001 From: Adphi Date: Thu, 14 Sep 2023 12:42:52 +0200 Subject: [PATCH] templates: clean package manager cache Signed-off-by: Adphi --- templates/centos.Dockerfile | 3 +++ templates/debian.Dockerfile | 3 +++ templates/ubuntu.Dockerfile | 3 +++ 3 files changed, 9 insertions(+) diff --git a/templates/centos.Dockerfile b/templates/centos.Dockerfile index a7ec18a..79f9f82 100644 --- a/templates/centos.Dockerfile +++ b/templates/centos.Dockerfile @@ -39,3 +39,6 @@ RUN cd /boot && \ mv $(find . -name 'vmlinuz-*') /boot/vmlinuz && \ mv $(find . -name 'initramfs-*.img') /boot/initrd.img {{- end }} + +RUN yum clean all && \ + rm -rf /var/cache/yum diff --git a/templates/debian.Dockerfile b/templates/debian.Dockerfile index 906cd79..5d8b036 100644 --- a/templates/debian.Dockerfile +++ b/templates/debian.Dockerfile @@ -74,3 +74,6 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends cr RUN mv $(find /boot -name 'vmlinuz-*') /boot/vmlinuz && \ mv $(find /boot -name 'initrd.img-*') /boot/initrd.img {{- end }} + +RUN apt-get clean && \ + rm -rf /var/lib/apt/lists/* diff --git a/templates/ubuntu.Dockerfile b/templates/ubuntu.Dockerfile index 3b4d4a3..24c9f7a 100644 --- a/templates/ubuntu.Dockerfile +++ b/templates/ubuntu.Dockerfile @@ -63,3 +63,6 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends cr RUN mv $(find /boot -name 'vmlinuz-*') /boot/vmlinuz && \ mv $(find /boot -name 'initrd.img-*') /boot/initrd.img {{- end }} + +RUN apt-get clean && \ + rm -rf /var/lib/apt/lists/*